Modified for authentication with prefix in uri.