-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customize namespace for EncryptedAssertion tag
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,4 +567,17 @@ test('send login response with encrypted non-signed assertion with EncryptThenS | |
t.is(typeof extract.signature, 'string'); | ||
}); | ||
|
||
test('Customize prefix (saml2) for encrypted assertion tag', async t => { | ||
const idpCustomizePfx = identityProvider(Object.assign(defaultIdpConfig, { tagPrefix: { | ||
encryptedAssertion: 'saml2', | ||
}})); | ||
const { id, context: SAMLResponse } = await idpCustomizePfx.createLoginResponse(sp, null, 'post', { email: '[email protected]' }); | ||
t.is((utility.base64Decode(SAMLResponse) as string).includes('saml2:EncryptedAssertion'), true); | ||
const { samlContent, extract } = await sp.parseLoginResponse(idpCustomizePfx, 'post', { body: { SAMLResponse } }); | ||
}); | ||
|
||
test('Customize prefix (default is saml) for encrypted assertion tag', async t => { | ||
const { id, context: SAMLResponse } = await idp.createLoginResponse(sp, null, 'post', { email: '[email protected]' }); | ||
t.is((utility.base64Decode(SAMLResponse) as string).includes('saml:EncryptedAssertion'), true); | ||
const { samlContent, extract } = await sp.parseLoginResponse(idp, 'post', { body: { SAMLResponse } }); | ||
}); |