firebase / firebase/firebase-admin-dotnet

CreateSessionCookieAsync use wrong url to make request to the API

Open
#331 1 comment 0 reactions 1 assignee Claimed by @lahirumaramba View on GitHub
api: auth
Dominant language
C#
Stars
408
Forks
146
Avg merge
22h 7m
Merged PRs (30d)
1

Description

### [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](https://cloud.google.com/identity-platform/docs/reference/rest/v1/projects/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:

https://github.com/firebase/firebase-admin-dotnet/blob/0870aa628e2b6b7632001e1d5c9a2e782cda3598/FirebaseAdmin/FirebaseAdmin/Auth/Users/FirebaseUserManager.cs#L386

https://github.com/firebase/firebase-admin-dotnet/blob/0870aa628e2b6b7632001e1d5c9a2e782cda3598/FirebaseAdmin/FirebaseAdmin/Auth/Users/FirebaseUserManager.cs#L430

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.