Skip to content

Commit 51170c9

Browse files
committed
feat(saml11): adds saml11.createUnsignedAssertion()
1 parent 433003e commit 51170c9

File tree

3 files changed

+418
-366
lines changed

3 files changed

+418
-366
lines changed

lib/saml11.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,36 @@ exports.create = function(options, callback) {
7070
}, callback);
7171
}
7272

73+
/**
74+
* Creates an **unsigned** SAML 1.1 assertion from the given options.
75+
*
76+
* @param options
77+
*
78+
* // SAML
79+
* @param [options.uid] {string}
80+
* @param [options.issuer] {string}
81+
* @param [options.lifetimeInSeconds] {number}
82+
* @param [options.audiences] {string|string[]}
83+
* @param [options.attributes]
84+
* @param [options.nameIdentifier] {string}
85+
* @param [options.nameIdentifierFormat] {string}
86+
*
87+
* // XML encryption
88+
* @param [options.encryptionCert] {Buffer}
89+
* @param [options.encryptionPublicKey] {Buffer}
90+
* @param [options.encryptionAlgorithm] {string}
91+
* @param [options.keyEncryptionAlgorighm] {string}
92+
*
93+
* @param {Function} [callback] required if encrypting
94+
* @return {String|*}
95+
*/
96+
exports.createUnsignedAssertion = function(options, callback) {
97+
return createAssertion(extractSaml11Options(options), {
98+
signXml: SignXml.unsigned,
99+
encryptXml: EncryptXml.fromEncryptXmlOptions(options)
100+
}, callback);
101+
}
102+
73103
function createAssertion(options, strategies, callback) {
74104
var doc;
75105
try {

0 commit comments

Comments
 (0)