首页 > 解决方案 > Wsfedsaml2 - 解密密钥

问题描述

我正在尝试使用此 api:https ://github.com/auth0/passport-wsfed-saml2在我的应用程序中实现 SSO。我已经在虚拟框中配置了 ADFS 服务。

当我尝试登录时,它会给出以下消息:断言已加密。请使用您的解密私钥设置 options.decryptionKey。

我在哪里可以得到这个解密密钥?我有点失落。

提前致谢。

标签: adfs

解决方案


据我了解,您必须将私钥副本保存在代码库中或从某个环境变量中读取。在你的代码中

passport.use('wsfed-saml2', new wsfedsaml2({
  protocol: "samlp",
    // This is the private key (use case where ADFS
    // is configured for RP token encryption)
    decryptionKey: fs.readFileSync("your+key+path+privateKey")
}, function (profile, done) {
 // ...
}));

希望这可以帮助


推荐阅读