gpt4 book ai didi

javascript - 使用 Open ID 与身份验证代码流连接 Azure AD

转载 作者:行者123 更新时间:2023-12-02 21:17:23 25 4
gpt4 key购买 nike

我正在对 NodeJS、Express Web 应用程序进行身份验证,我希望将用户路由到 Microsoft SSO。我正在使用 Passport azure ad 和 open id connect 来执行此操作。

但是我想知道的是 -

是否只能通过隐式授权进行 Open ID 连接?或c我们可以使用 auth 流程进行 open id 连接吗?如果是,passport-azure-ad 支持吗?

最佳答案

根据document OpenID Connect 中,发送登录请求时会请求 id_token(response_type 为“id_token”)。从document中我们可以看到在身份验证代码流中,response_type 是“code”。但我们根据这个tutorialresponse_type 也可以是身份验证代码流中的“code id_token”。

enter image description here

因此我们也可以在身份验证代码流程中进行 open id connect。

如果您想使用passport-azure-ad,这里是method (用于授权代码流程)供您引用。 enter image description hereparams 是我们从请求或元数据中获取的项目,例如 id_token、code、policy、metadata、cacheKey 等

oauthConfig 是 oauth 流程所需的项目(如重定向、代码兑换),例如 token_endpoint、userinfo_endpoint 等

optionsToValidate 是我们需要验证 id_token 的项目,例如发行者、受众等

希望对你有帮助~

关于javascript - 使用 Open ID 与身份验证代码流连接 Azure AD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60932973/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com