Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

saml

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saml - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

4

lib/saml11.js

@@ -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 = {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc