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

Fetch attribute value #536

Merged
merged 2 commits into from
Jan 24, 2021
Merged

Fetch attribute value #536

merged 2 commits into from
Jan 24, 2021

Conversation

JDrizzy
Copy link
Contributor

@JDrizzy JDrizzy commented Apr 17, 2020

After setting up an AD-FS SSO and trying to pass a users first and last name through attributes, I found that AD-FS passes the following attribute names which are annoying/ugly to match:

# Attributes
{
  'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => ['Jarrad'],
  'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => ['M'],
}
saml_response.attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname']
# Jarrad

I thought a #fetch might be ideal here to handle cases where one might want to retrieve an attribute value using regular expression?

# Attributes
{
  'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => ['Jarrad'],
  'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => ['M'],
}
saml_response.attributes.fetch(/givenname/)
# Jarrad
saml_response.attributes.fetch(/surname/)
# M

Happy to hear your thoughts ✌️

@coveralls
Copy link

coveralls commented Apr 17, 2020

Coverage Status

Coverage increased (+0.008%) to 97.892% when pulling 1ae0c82 on JDrizzy:master into 811618d on onelogin:master.

@pitbulk
Copy link
Collaborator

pitbulk commented May 29, 2020

I believe that makes sense. Can you update the documentation of the Readme as well?

@JDrizzy JDrizzy marked this pull request as ready for review June 2, 2020 11:45
@pitbulk pitbulk changed the base branch from master to 1.12.0-dev January 24, 2021 17:19
@pitbulk pitbulk merged commit d3b5913 into SAML-Toolkits:1.12.0-dev Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants