Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Add '.value' in the SAML package to fix TypeErrors on SAML token validation #10084

Merged
merged 5 commits into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/meteor-accounts-saml/saml_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ const middleware = function(req, res, next) {
throw new Error(`Unable to validate response url: ${ err }`);
}

const credentialToken = profile.inResponseToId || profile.InResponseTo || samlObject.credentialToken;
const credentialToken = profile.inResponseToId.value || profile.InResponseTo || samlObject.credentialToken;
if (!credentialToken) {
// No credentialToken in IdP-initiated SSO
const saml_idp_credentialToken = Random.id();
Expand Down
2 changes: 1 addition & 1 deletion packages/meteor-accounts-saml/saml_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ SAML.prototype.validateResponse = function(samlResponse, relayState, callback) {
}
}

if (!profile.email && profile.nameID && profile.nameIDFormat && profile.nameIDFormat.indexOf('emailAddress') >= 0) {
if (!profile.email && profile.nameID && profile.nameIDFormat && profile.nameIDFormat.value.indexOf('emailAddress') >= 0) {
profile.email = profile.nameID;
}
if (Meteor.settings.debug) {
Expand Down