maj*_*ann 5 firebase google-cloud-platform firebase-authentication
我一直在尝试向我的应用程序添加对多租户的支持。
我像这样初始化
const app = firebase.initializeApp();
const tenantManager = app.auth().tenantManager();
const tenant = await tenantManager.createTenant({ displayName: `test- tenant` });
const auth = tenantManager.authForTenant(tenantId);
Run Code Online (Sandbox Code Playgroud)
然后,我的应用程序的一部分使用auth.createCustomToken(uid)来创建一个令牌,然后可以将该令牌交换为标准 id 令牌(使用其余端点/accounts:signInWithCustomToken.
尝试创建自定义令牌时出现以下错误
Error: This operation is not supported in a multi-tenant context
Run Code Online (Sandbox Code Playgroud)
除此之外,手动创建令牌(使用jsonwebtoken服务帐户密钥)时会出现错误
Specified tenant ID does not match the custom token
Run Code Online (Sandbox Code Playgroud)
尝试验证令牌时出现(通过 REST API)
有其他人遇到过此错误,或者有人知道在多租户环境中生成和验证自定义令牌的另一种方法(或者,知道仅给定 uid 的用户登录的某种方法)?
| 归档时间: |
|
| 查看次数: |
1596 次 |
| 最近记录: |