Skip to content

Commit

Permalink
Use the spread operator to pass in any saml configuration (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Nov 7, 2022
1 parent ea3147f commit 24fe69c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/WebLoginAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ export class WebLoginAuth {
// Configure passport for SAML
this.saml = new SamlStrategy(
{
name: this.config.saml.name,
path: this.config.saml.path,
callbackUrl: this.config.saml.callbackUrl,
issuer: this.config.saml.issuer,
logoutUrl: this.config.saml.loginPath,
forceAuthn: this.config.saml.forceAuthn,
decryptionPvk: this.config.saml.decryptionPvk,
entryPoint: idps[this.config.saml.idp].entryPoint,
cert: idps[this.config.saml.idp].cert,
wantAssertionsSigned: true,
Expand All @@ -66,6 +60,7 @@ export class WebLoginAuth {
acceptedClockSkewMs: 60000,
skipRequestCompression: false,
passReqToCallback: true,
...this.config.saml,
},
(req, profile, done) => {
const user = attrMapper(profile);
Expand All @@ -80,7 +75,7 @@ export class WebLoginAuth {
eduPersonPrincipalName: user.eduPersonPrincipalName,
eduPersonScopedAffiliation: user.eduPersonScopedAffiliation,
sn: user.sn,
}
};
done(null, account);
}
);
Expand Down Expand Up @@ -283,7 +278,7 @@ export class WebLoginAuth {
*/
public generateServiceProviderMetadata = () => {
return this.saml.generateServiceProviderMetadata(this.config.saml.decryptionCert, this.config.saml.cert);
}
};
}

// Singleton client for default consumption
Expand Down

0 comments on commit 24fe69c

Please sign in to comment.