firebase / firebase/firebase-admin-python

Unable to create session cookie for tenant users

Đang mở
#577 17 bình luận 3 reaction 1 người được giao Được giao cho @prameshj Xem trên GitHub
api: auth
Ngôn ngữ chính
Python
Star
1.2k
Fork
359
Merge trung bình
5 ngày 6 phút
Pull request đã merge (30 ngày)
2

Mô tả

Hey everyone

I am setting up a python application and I would like to use firebase for authentication.
For normal users the login flows works fine, my problem comes when I start using tenants.

---

When a user authenticates to my app, it gets a token and then, after verification, the token is exchanged for a long-lived session cookie. As mentioned before, this works great for normal users.

I am using the exact code described in the docs here: https://firebase.google.com/docs/auth/admin/manage-cookies#create_session_cookie

When I authenticate users that are part of a tenant though, I can't find a way to convert their token into a session cookie.

I tried using `session_cookie = auth.create_session_cookie(id_token, expires_in=expires_in, app=tenant_app)` but I get always the same error message:

```
Error while calling Auth service (UNSUPPORTED_TENANT_OPERATION).
```

Am I missing something ? I am using the latest version of firebase-admin

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.