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

When login in with CiLogon first name and last names are switched. Also an error is thrown "Cannot read property 'first_name'" #39

Open
eroma2014 opened this issue Oct 8, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@eroma2014
Copy link

eroma2014 commented Oct 8, 2020

Description

First name and last name switched when login in with institute credentials.
But was able to get access to the portal without any issue.

Experienced the same when tried gmail through CILogon as well. Image attached with the error
Screen Shot 2020-10-09 at 8 47 32 AM

Steps to Reproduce

  1. In the portal click Login with Institution
  2. Select the institute
  3. Errors are thrown when logged in
  4. In Manage users, can view the name switch.

Expected Behaviour

Your Environment

https://demo.gateway.custos.scigap.org/

  • Custos branch or release version used:
  • Operating system and version:

Additional Context

Screen Shot 2020-10-08 at 3 57 42 PM

@eroma2014 eroma2014 added the bug Something isn't working label Oct 8, 2020
@eroma2014
Copy link
Author

Tested on 10/14/20 in https://testdrive.usecustos.org/
Still, the names are switched but users can change in their user profile.
Need to investigate whether this is coming from cilogon in the switched form.

@machristie
Copy link
Contributor

I realized I posted my comment in the wrong issue, here it is:


I'm pretty sure this is related to this bug in Keycloak where it prefers parsing name over using given_name and family_name claims: https://issues.redhat.com/browse/KEYCLOAK-10932

We worked around this by explicitly mapping given_name to firstName and family_name to lastName using a Keycloak Attribute Mapper. From our internal CILogon notes:

Add the following attribute mappers

  • family_name
    • name: family_name
    • Mapper Type: Attribute Importer
    • claim: family_name
    • User Attribute Name: lastName
  • given_name
    • name: given_name
    • Mapper Type: Attribute Importer
    • claim: given_name
    • User Attribute Name: firstName

Claim mapping documentation: http://www.keycloak.org/docs/2.5/server_admin/topics/identity-broker/mappers.html

That link is broken, but this one works: https://www.keycloak.org/docs/4.8/server_admin/index.html#_mappers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants