-
Notifications
You must be signed in to change notification settings - Fork 29
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
Correctly parse Attributes with multiple AttributeValues as arrays of strings #27
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added yr changes manually as there were conflicts (and yr code is just a few lines). Wanna rebase and try to push?
if (Meteor.settings.debug) { | ||
console.log("Name: " + attributes[i]); | ||
console.log(`Adding attrinute from SAML response to profile:` + attributes[i].getAttribute('Name') + " = " + value.textContent); | ||
console.log(`Adding attribute from SAML response to profile:` + attributes[i].getAttribute('Name') + " = " + value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why you're using 'value' vs 'value.textContent'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of multiple attribute values, where "value" is an array, "value.textContent" will be undefined. Logging "value" should work whether it is a string or an array.
# Conflicts: # saml_utils.js
It may be simpler to keep your manual update and discard the PR :-) |
@steffow thanks for this package.
to:
|
Hey atao60 - thanks for bringing this up. I would need to look at this, but IIIRC I changed this because it made one of my test fail.
Do you have an example to see the difference?
S.
… On 13. Jan 2019, at 09:16, atao60 ***@***.***> wrote:
@steffow thanks for this package.
It seems to me that not all the changes of PR #27 have been made in the current code (v0.0.17).
Then it's not working as it.
I had to change the lines 464 and 466 (v0.0.17) from:
console.log(`Adding attrinute from SAML response to profile:` + attributes[i].getAttribute('Name') + " = " + value.textContent);
profile[attributes[i].getAttribute('Name')] = value.textContent;
to:
console.log(`Adding attribute from SAML response to profile:` + attributes[i].getAttribute('Name') + " = " + value);
profile[attributes[i].getAttribute('Name')] = value;
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@steffow what do you need? Some code in a github repo? |
Implemented fix for #26
If one AttributeValue exists, it is returned as a string (as per current behaviour).
If more than one AttributeValue exists, they are returned as an array of strings.