javascript - Firebase Web 客户端和 OIDC 提供程序问题
问题描述
我在 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 客户端 SDK 和 AngularFire2,并且我已经成功配置了电子邮件/密码身份验证。在 Google 身份平台中,我有:
发行人(网址):
https://auth.example.com/auth/realms/myrealm
和回调网址:
https://myapp-12345.firebaseapp.com/__/auth/handler
我需要在客户端进行其他配置吗?问题可能出在 OIDC 提供程序 (Keycloak) 及其配置上吗?
解决方案
您似乎在 Google Cloud Identity Platform 设置(在 Google Cloud Console 中)中禁用了客户端 SDK 的用户注册。这是在Settings
下面的部分User actions
。Enable create (sign-up)
应选中该复选框。
推荐阅读
- unity3d - Unity Navmesh 代理在地形上的行为
- python - 这个程序是如何工作的?firstGreaterEqual 方法如何工作
- typescript - 通过装饰器访问方法参数
- arrays - VB.net 使用数组中的 GroupBox
- python - 找不到行魔术函数`%store`
- c++ - 每次重新编译未修改的 .cpp 文件的一些原因是什么?
- wordpress - 我如何让我的产品主页回到 woocommerce
- c# - 使用后台 Worker 将文本文件插入列表框 WPF
- string - 字符串集中最长的前缀+后缀组合
- functional-programming - 在erlang中读取特定内容的文件