Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
BindingNamespace,
ParserType,
wording,
MessageSignatureOrder,
StatusCode
} from './urn';

Expand Down Expand Up @@ -225,6 +224,7 @@ async function postFlow(options): Promise<FlowResult> {
// Encrypted Assertion, the assertion is signed
const result = await libsaml.decryptAssertion(self, samlContent);
const decryptedDoc = result[0];
samlContent = decryptedDoc;
const [decryptedDocVerified, verifiedDecryptedAssertion] = libsaml.verifySignature(decryptedDoc, verificationOptions);
if (decryptedDocVerified) {
// extractor depends on signed content
Expand Down
3 changes: 3 additions & 0 deletions test/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ test('send response with signed assertion and parse it', async t => {
t.is(typeof id, 'string');
t.is(samlContent.startsWith('<samlp:Response'), true);
t.is(samlContent.endsWith('/samlp:Response>'), true);
t.is(samlContent.includes('>user@esaml2.com</saml:NameID>'), true);
t.is(extract.nameID, 'user@esaml2.com');
t.is(extract.response.inResponseTo, 'request_id');
});
Expand Down Expand Up @@ -929,6 +930,7 @@ test('send login response with encrypted non-signed assertion and parse it', asy
t.is(typeof id, 'string');
t.is(samlContent.startsWith('<samlp:Response'), true);
t.is(samlContent.endsWith('/samlp:Response>'), true);
t.is(samlContent.includes('>user@esaml2.com</saml:NameID>'), true);
t.is(extract.nameID, 'user@esaml2.com');
t.is(extract.response.inResponseTo, 'request_id');
});
Expand Down Expand Up @@ -1101,6 +1103,7 @@ test('send login response with encrypted non-signed assertion with EncryptThenSi
t.is(typeof id, 'string');
t.is(samlContent.startsWith('<samlp:Response'), true);
t.is(samlContent.endsWith('/samlp:Response>'), true);
t.is(samlContent.includes('>user@esaml2.com</saml:NameID>'), true);
t.is(extract.nameID, 'user@esaml2.com');
});

Expand Down