Skip to content

Commit

Permalink
Add code to invalidSAMLIssuer
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Apr 27, 2024
1 parent 3538140 commit 768f78d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ class SamlLogin {

const issuer = issuerResult?.Issuer?._ || issuerResult?.Issuer?.[0]?._;
if (options.expectedProviderIssuer && issuer && issuer !== options.expectedProviderIssuer) {
throw new Error("Unknown SAML issuer. Expected: " + options.expectedProviderIssuer + " Received: " + issuer);
const error = new Error("Unknown SAML issuer. Expected: " + options.expectedProviderIssuer + " Received: " + issuer);
error.code = 'InvalidIssuer';
throw error
}

const inResponseToNodes = xpath.selectAttributes(doc, "/*[local-name()='Response']/@InResponseTo");
Expand Down

0 comments on commit 768f78d

Please sign in to comment.