Comparing version 1.7.0 to 1.8.0
@@ -464,4 +464,7 @@ // Generated by CoffeeScript 1.7.1 | ||
get_session_index = function(dom) { | ||
get_session_index = function(dom, index_required) { | ||
var assertion, attr, authn_statement, _i, _len, _ref; | ||
if (index_required == null) { | ||
index_required = true; | ||
} | ||
assertion = dom.getElementsByTagNameNS(XMLNS.SAML, 'Assertion'); | ||
@@ -482,3 +485,7 @@ if (assertion.length !== 1) { | ||
} | ||
throw new Error("SessionIndex not an attribute of AuthnStatement."); | ||
if (index_required) { | ||
throw new Error("SessionIndex not an attribute of AuthnStatement."); | ||
} else { | ||
return null; | ||
} | ||
}; | ||
@@ -588,3 +595,3 @@ | ||
parse_authn_response = function(saml_response, sp_private_keys, idp_certificates, allow_unencrypted, ignore_signature, cb) { | ||
parse_authn_response = function(saml_response, sp_private_keys, idp_certificates, allow_unencrypted, ignore_signature, require_session_index, cb) { | ||
var user; | ||
@@ -637,3 +644,3 @@ user = {}; | ||
user.name_id = get_name_id(decrypted_assertion); | ||
user.session_index = get_session_index(decrypted_assertion); | ||
user.session_index = get_session_index(decrypted_assertion, require_session_index); | ||
assertion_attributes = parse_assertion_attributes(decrypted_assertion); | ||
@@ -719,4 +726,6 @@ user = _.extend(user, pretty_assertion_attributes(assertion_attributes)); | ||
ServiceProvider.prototype.redirect_assert = function(identity_provider, options, cb) { | ||
options = _.extend(options, { | ||
options = _.defaults(_.extend(options, { | ||
get_request: true | ||
}), { | ||
require_session_index: true | ||
}); | ||
@@ -728,4 +737,6 @@ options = set_option_defaults(options, identity_provider.shared_options, this.shared_options); | ||
ServiceProvider.prototype.post_assert = function(identity_provider, options, cb) { | ||
options = _.extend(options, { | ||
options = _.defaults(_.extend(options, { | ||
get_request: false | ||
}), { | ||
require_session_index: true | ||
}); | ||
@@ -774,3 +785,3 @@ options = set_option_defaults(options, identity_provider.shared_options, this.shared_options); | ||
response.type = 'authn_response'; | ||
return parse_authn_response(saml_response, [_this.private_key].concat(_this.alt_private_keys), identity_provider.certificates, options.allow_unencrypted_assertion, options.ignore_signature, cb_wf); | ||
return parse_authn_response(saml_response, [_this.private_key].concat(_this.alt_private_keys), identity_provider.certificates, options.allow_unencrypted_assertion, options.ignore_signature, options.require_session_index, cb_wf); | ||
case saml_response.getElementsByTagNameNS(XMLNS.SAMLP, 'LogoutResponse').length !== 1: | ||
@@ -777,0 +788,0 @@ if (!check_status_success(saml_response)) { |
{ | ||
"name": "saml2-js", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "SAML 2.0 node helpers", | ||
@@ -5,0 +5,0 @@ "author": "Clever", |
@@ -108,2 +108,3 @@ # SAML2-js | ||
- `allow_unencrypted_assertion` - (Boolean) - If true, allows unencrypted assertions. This can also be configured on the [IdP](#IdentityProvider) or [SP](#ServiceProvider). | ||
- `require_session_index` - (Boolean) - If false, allow the assertion to be valid without a `SessionIndex` attribute on the `AuthnStatement` node. | ||
- `cb(error, response)` - Callback called with the [request response](#assert_response). | ||
@@ -136,2 +137,3 @@ | ||
- `allow_unencrypted_assertion` - (Boolean) - If true, allows unencrypted assertions. This can also be configured on the [IdP](#IdentityProvider) or [SP](#ServiceProvider). | ||
- `require_session_index` - (Boolean) - If false, allow the assertion to be valid without a `SessionIndex` attribute on the `AuthnStatement` node. | ||
- `cb(error, response)` - Callback called with the [request response](#assert_response). | ||
@@ -138,0 +140,0 @@ |
Sorry, the diff of this file is not supported yet
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
145415
31
857
287