我在 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 inid_token
against user providedissuer
values and the issuer value we get from tenant-specific endpoint. If you use common endpoint foridentityMetadata
and you want to validateissuer
, then you have to either provide issuer, or provide the tenant for each login request usingtenantIdOrName
option in passport.authenticate.
更多关于 Passport 选项的详细信息,您可以引用this article .
希望这有帮助!
关于node.js - 为什么我们需要 Azure B2C Passport 中的验证发行者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49190646/