Add option to control SAML callback

This commit is contained in:
Piotr Orzechowski
2018-03-07 11:17:59 +01:00
parent e9d03aeac3
commit 31f53dc220
2 changed files with 19 additions and 2 deletions

View File

@@ -33,8 +33,7 @@ module.exports = function(options) {
}
var samlConfig = {
path: '/auth/saml/callback'
, entryPoint: options.saml.entryPoint
entryPoint: options.saml.entryPoint
, issuer: options.saml.issuer
}
@@ -44,6 +43,17 @@ module.exports = function(options) {
})
}
if (options.saml.callbackUrl) {
samlConfig = _.merge(samlConfig, {
callbackUrl: options.saml.callbackUrl
})
}
else {
samlConfig = _.merge(samlConfig, {
path: '/auth/saml/callback'
})
}
passport.use(new SamlStrategy(samlConfig, verify))
app.use(passport.authenticate('saml', {