我在 Google Identity Platform 控制台中配置了一个 OIDC 提供程序(链接到 Keycloak OIDC 提供程序)。这是我的单页应用程序中的代码:
provider = new firebase.auth.OAuthProvider('oidc.keycloak');
firebaseAuth.auth.signInWithPopup(provider)
.then(value => {
log.info(`It worked!`, value);
})
.catch(err => {
log.info('Something went wrong:', err);
});
弹出窗口出现,我可以登录Keycloak,但弹出窗口消失后,浏览器中抛出以下错误:
{code: "auth/admin-restricted-operation", message: "This operation is restricted to administrators only."}
我使用的是最新版本的 Firebase Client SDK 和 AngularFire2,并且我已经成功配置了电子邮件/密码身份验证。 在 Google Identity Platform 中,我有:
颁发者(URL):
https://auth.example.com/auth/realms/myrealm
和 回调地址:
https://myapp-12345.firebaseapp.com/__/auth/handler
我需要在客户端进行额外的配置吗?问题可能出在 OIDC 提供商 (Keycloak) 及其配置上吗?
最佳答案
您似乎在 Google Cloud Identity Platform 设置(在 Google Cloud Console 中)中禁用了客户端 SDK 的用户注册。这位于 User actions
下的 Settings
部分。应选中复选框 Enable create (sign-up)
。
关于javascript - Firebase 网络客户端和 OIDC 提供商问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57749081/