fix: update saml strategy to use new config options

This commit is contained in:
Nicolas Giard
2022-05-02 00:18:19 -04:00
committed by GitHub
parent fd274e49f8
commit 8205c1f243
2 changed files with 59 additions and 22 deletions

View File

@@ -10,16 +10,21 @@ const SAMLStrategy = require('passport-saml').Strategy
module.exports = {
init (passport, conf) {
let samlConfig = {
const samlConfig = {
callbackUrl: conf.callbackURL,
entryPoint: conf.entryPoint,
issuer: conf.issuer,
cert = _.split(conf.cert, '|'),
signatureAlgorithm: conf.signatureAlgorithm,
digestAlgorithm: conf.digestAlgorithm,
identifierFormat: conf.identifierFormat,
wantAssertionsSigned: conf.wantAssertionsSigned,
acceptedClockSkewMs: _.toSafeInteger(conf.acceptedClockSkewMs),
disableRequestedAuthnContext: conf.disableRequestedAuthnContext,
authnContext: conf.authnContext,
racComparison: conf.racComparison,
forceAuthn: conf.forceAuthn,
passive: conf.passive,
providerName: conf.providerName,
skipRequestCompression: conf.skipRequestCompression,
authnRequestBinding: conf.authnRequestBinding,
@@ -28,11 +33,8 @@ module.exports = {
if (!_.isEmpty(conf.audience)) {
samlConfig.audience = conf.audience
}
if (!_.isEmpty(conf.cert)) {
samlConfig.cert = _.split(conf.cert, '|')
}
if (!_.isEmpty(conf.privateCert)) {
samlConfig.privateCert = conf.privateCert
if (!_.isEmpty(conf.privateKey)) {
samlConfig.privateKey = conf.privateKey
}
if (!_.isEmpty(conf.decryptionPvk)) {
samlConfig.decryptionPvk = conf.decryptionPvk