javascript - Firebase 网络客户端和 OIDC 提供商问题

标签 javascript firebase firebase-authentication google-identity-toolkit

我在 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/

相关文章:

android - 在 Activity 消失时删除 Firebase 监听器?

firebase - 我可以使用 auth :import and auth:export tools with the Firebase Auth Emulator?

javascript - Firebase - 防止基于角色的身份验证

javascript - Google 登录身份验证功能不起作用(Google firebase)

firebase - 如何通过 REST api 在 ruby​​ 中进行身份验证

javascript - 修改之前在JS中定义的样式

javascript - Meteor - 集合未保存到指定的 Mongo URL

javascript - 正则表达式查找至少包含一个大写字母的子字符串

javascript - 比较 2 个数组的相似性并在控制台中显示差异

java - 如何使用具有 2 种布局的 FirebaseListAdapter