Firebase Discord OIDC(开放 ID)

问题描述 投票:0回答:1

一直在寻找一种将 Discord Auth 与 Open ID 连接起来的方法 我已根据 Firebase Open ID 文档完成了所有步骤: https://firebase.google.com/docs/auth/web/openid-connect?hl=en&authuser=0

我找到了一个类似的身份验证提供商,使用 OpenID 连接到 Discord,并且他们有一个自定义发行者配置,因为 Discord 不提供

.well-known/openid-configuration

来源:https://fusionauth.io/docs/lifecycle/authenticate-users/identity-providers/gaming/discord

设置为:

代码流程

不和谐

来自 Discord 应用程序的客户端 ID

发行者(URL):https://cdn.myproject.cloudflare.com/discord/ *见下文

来自 Discord 应用程序的客户端 ID

在 OAuth2 下的 Discord Dev 门户中 重定向有

https://myproject.firebaseapp.com/__/auth/handler

*发行人网址

https://cdn.myproject.cloudflare.com/discord/

指向“.well-known”目录中名为“openid-configuration”的公共 json 数据文件

发行者 URL/.well-known/openid-configuration 的内容:

{
    "issuer": "https://discord.com",
    "authorization_endpoint": "https://discord.com/api/oauth2/authorize",
    "token_endpoint": "https://discord.com/api/oauth2/token",
    "userinfo_endpoint": "https://discord.com/api/users/@me",
    "scopes_supported": [
        "openid",
        "email",
        "profile"
    ]
}

这是通过我的应用程序与其他身份验证提供商启用的。 我是否需要使用 URL 生成器来生成发行者 URL 或其他内容?

简单的事实是 Firebase 不允许自定义颁发者 URL 覆盖。

错误:使用 Discord 登录时出错:FirebaseError:Firebase:错误(不允许身份验证/操作)。 在 createErrorInternal (assert.ts:161:7)

firebase firebase-authentication discord openid-connect openid
1个回答
0
投票

对此不太熟悉,只是通读一下,但如果您使用 FusionAuth 对使用 Discord 作为登录方法的用户进行身份验证,那么您必须将 FusionAuth 设置为 Firebase 的身份提供商 (IdP)。因此 Firebase 上的颁发者将是 FusionAuth,那么一旦 fusionAuth 通过 Discord 确认用户的身份验证,身份验证令牌将被传递到 Firebase 以确认 Firebase 身份验证。

© www.soinside.com 2019 - 2024. All rights reserved.