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

Required mapping for assertion #87

Closed
khash opened this issue Mar 19, 2017 · 4 comments
Closed

Required mapping for assertion #87

khash opened this issue Mar 19, 2017 · 4 comments

Comments

@khash
Copy link

khash commented Mar 19, 2017

This is the payload I'm getting from Okta and the example attribute-map.yml doesn't pick up the attributes. Here is my attribute-map.yml:

"urn:mace:dir:attribute-def:uid": "email"
"urn:mace:dir:attribute-def:email": "email"
"urn:mace:dir:attribute-def:lastName": "last_name"
"urn:mace:dir:attribute-def:firstName": "first_name"
"urn:mace:dir:attribute-def:engineering": "engineering"

Could you help me find the right mapping please?

Payload:

...
<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
      <saml2:Attribute Name="engineering" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">true</saml2:AttributeValue>
      </saml2:Attribute>
      <saml2:Attribute Name="firstName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">John</saml2:AttributeValue>
      </saml2:Attribute>
      <saml2:Attribute Name="lastName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Doe</saml2:AttributeValue>
      </saml2:Attribute>
...
@taylor01
Copy link

taylor01 commented Mar 19, 2017

here is a copy of my attribute_map.yml for one of my apps.

# attribute-map.yml

  # "urn:mace:dir:attribute-def:uid": "user_name"
  # "urn:mace:dir:attribute-def:email": "email"
  "last_name": "last_name"
  "first_name": "first_name"

@taylor01
Copy link

so try this.

# attribute-map.yml

  # "urn:mace:dir:attribute-def:uid": "user_name"
  # "urn:mace:dir:attribute-def:email": "email"
  "firstName": "last_name"
  "lastName": "first_name"

assuming of course that first_name and last_name are attributes in your Devise setup.

@khash
Copy link
Author

khash commented Mar 19, 2017

Sweet! That fixed it.

Do you happen to know how I can get a list of groups the user is a member of from Okra as an attribute?

@adamstegman
Copy link
Collaborator

I'm going to go ahead and close this, but if you want to add more information about using Okta, please do! https://github.com/apokalipto/devise_saml_authenticatable/wiki/Okta

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

No branches or pull requests

3 participants