Comparing version 0.2.6 to 0.2.7
@@ -109,3 +109,5 @@ | ||
if (options.nameIdentifierFormat) { | ||
nameID.setAttribute('Format', options.nameIdentifierFormat); | ||
var nameIDs = doc.documentElement.getElementsByTagNameNS(NAMESPACE, 'NameIdentifier'); | ||
nameIDs[0].setAttribute('Format', options.nameIdentifierFormat); | ||
nameIDs[1].setAttribute('Format', options.nameIdentifierFormat); | ||
} | ||
@@ -112,0 +114,0 @@ |
{ | ||
"name": "saml", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "mocha": "*", |
@@ -193,6 +193,61 @@ var assert = require('assert'), | ||
.textContent; | ||
console.log(nameIdentifier); | ||
assert.equal('foo', nameIdentifier); | ||
}); | ||
it('should set AuthenticationStatement NameFormat', function () { | ||
var options = { | ||
cert: fs.readFileSync(__dirname + '/test-auth0.pem'), | ||
key: fs.readFileSync(__dirname + '/test-auth0.key'), | ||
nameIdentifier: 'foo' | ||
}; | ||
var signedAssertion = saml11.create(options); | ||
var format = utils.getAuthenticationStatement(signedAssertion) | ||
.getElementsByTagName('saml:NameIdentifier')[0] | ||
.getAttribute('Format'); | ||
assert.equal('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', format); | ||
}); | ||
it('should set AttirubteStatement NameFormat', function () { | ||
var options = { | ||
cert: fs.readFileSync(__dirname + '/test-auth0.pem'), | ||
key: fs.readFileSync(__dirname + '/test-auth0.key'), | ||
nameIdentifier: 'foo' | ||
}; | ||
var signedAssertion = saml11.create(options); | ||
var format = utils.getNameIdentifier(signedAssertion) | ||
.getAttribute('Format'); | ||
assert.equal('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', format); | ||
}); | ||
it('should override AttirubteStatement NameFormat', function () { | ||
var options = { | ||
cert: fs.readFileSync(__dirname + '/test-auth0.pem'), | ||
key: fs.readFileSync(__dirname + '/test-auth0.key'), | ||
nameIdentifier: 'foo', | ||
nameIdentifierFormat: 'http://foo' | ||
}; | ||
var signedAssertion = saml11.create(options); | ||
var format = utils.getNameIdentifier(signedAssertion) | ||
.getAttribute('Format'); | ||
assert.equal('http://foo', format); | ||
}); | ||
it('should override AttirubteStatement NameFormat', function () { | ||
var options = { | ||
cert: fs.readFileSync(__dirname + '/test-auth0.pem'), | ||
key: fs.readFileSync(__dirname + '/test-auth0.key'), | ||
nameIdentifier: 'foo', | ||
nameIdentifierFormat: 'http://foo' | ||
}; | ||
var signedAssertion = saml11.create(options); | ||
var format = utils.getAuthenticationStatement(signedAssertion) | ||
.getElementsByTagName('saml:NameIdentifier')[0] | ||
.getAttribute('Format'); | ||
assert.equal('http://foo', format); | ||
}); | ||
it('should test the whole thing', function () { | ||
@@ -199,0 +254,0 @@ var options = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25500
445