Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable requested authentication context #5

Merged
merged 5 commits into from
Oct 1, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ module.exports = {
config.entryPoint = config.identityProviderUrl;
config.callbackUrl = options.callbackUrl || (options.apos.options.baseUrl + '/auth/saml/login/callback');

//Add our extra passportSamlOptions into our config object
config = self.addPassportSamlOptions(config);

var strategy = new passportSaml.Strategy(
config,
self.profileCallback
Expand Down Expand Up @@ -85,6 +88,20 @@ module.exports = {
return '/auth/saml/login/callback';
}
};

self.addPassportSamlOptions = function(config) {
//merge the base configuration options into the passportSamlOptionsObject
//Note: if you have the same attribute in both objects, the base configuration option will overwrite the passportSamlOptions attribute {
for(var attr in options.passportSamlOptions){
if(attr in config){
continue; //Do not overwrite existing config attributes.
}
config[attr]=options.passportSamlOptions[attr]; //copy the optional attribute into our config object
}

return config;

};

self.addRoutes = function() {
self.apos.app.get(self.getLoginPath(),
Expand Down