wsfedsaml2-解密密钥

时间:2018-10-15 17:28:19

标签: adfs

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

当我尝试登录时,会显示以下消息:声明已加密。请使用您的解密私钥设置options.decryptionKey。

我从哪里获得此解密密钥?我有点迷茫。

谢谢。

1 个答案:

答案 0 :(得分:0)

根据我的理解,您必须将私钥副本保留在代码库中,或者从某些环境变量中读取。 在您的代码中

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) {
 // ...
}));

希望这会有所帮助