Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateSessionCookieAsync use wrong url to make request to the API #331

Open
AlexanderVorobyov opened this issue Aug 15, 2022 · 1 comment
Assignees

Comments

@AlexanderVorobyov
Copy link

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Windows 11
  • Firebase SDK version: 2.3.0
  • Firebase Product: Auth
  • .NET version: .NET Core 3.1
  • OS: Windows

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

CreateSessionCookieAsync always results with Not Found status code. (Tested with Emulator)

PostAndDeserializeAsync method builds URL always including / character between base Url and Path.

In case of createSessionCookie API the result url will be wrong:

Current:

Firebase: POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/:createSessionCookie
Emulator: POST http:/localhost:9099/identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/:createSessionCookie

Should be:

Firebase: POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}:createSessionCookie
Emulator: POST http:/localhost:9099/identitytoolkit.googleapis.com/v1/projects/{targetProjectId}:createSessionCookie

Relevant Code:

":createSessionCookie", request, cancellationToken).ConfigureAwait(false);

RequestUri = new Uri($"{this.baseUrl}/{path}"),

@AlexanderVorobyov
Copy link
Author

Also, I found that CreateSessionCookieVerifier() has missing setup for IsEmulatorMode argument and that causing the error when validate session cookie from emulator.

internal static FirebaseTokenVerifier CreateSessionCookieVerifier(

@lahirumaramba lahirumaramba self-assigned this Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants