node.js - 为什么我们需要 Azure B2C Passport 中的验证发行者?

标签 node.js passport.js azure-active-directory azure-ad-b2c

我在 Node 中有 Azure AD B2C,我想知道为什么我们使用 validateIssuer = true 或 false?

passport.use(new BearerStrategy({

    isB2C: true,
    validateIssuer: false,
    loggingLevel: 'trace',
    passReqToCallback: false,
}

如果我将其设为 false,它会向我发送警告,要求在生产环境中设为 true,那么为什么在使用 Passport Azure AD B2C 时需要验证发行者

最佳答案

显然,它可以决定是否验证id_token中的iss声明。解释如下:

validateIssuer (Conditional)

Required to set to false if you don't want to validate issuer, default value is true. We validate the iss claim in id_token against user provided issuer values and the issuer value we get from tenant-specific endpoint. If you use common endpoint for identityMetadata and you want to validate issuer, then you have to either provide issuer, or provide the tenant for each login request using tenantIdOrName option in passport.authenticate.

更多关于 Passport 选项的详细信息,您可以引用this article .

希望这有帮助!

关于node.js - 为什么我们需要 Azure B2C Passport 中的验证发行者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49190646/

相关文章:

node.js - 使用 NodeJS self 更新项目

node.js - 对 NodeJS(和 Passport 中间件) session 感到困惑

node.js - 使用 Passport js 进行身份验证时,用户为空

powershell - 无法设置 AzureRmKeyVaultAccessPolicy

javascript - 填充 Mongoose 后查找

javascript - 如何让两个promise同步执行?

javascript - JavaScript 的 2019 年巴西利亚夏令时

javascript - Passport local 使用 Angular 返回错误 400 错误请求

asp.net-mvc - 同时使用 AspNet.Identity 和 OpenConnectId(用于 Azure AD 登录)

azure - 使用 php 验证 Azure