Fix fetching claims from the UserInfo endpoint#1924
Conversation
For claims to be extraced from the UserInfo response, they must have corresponding `ClaimAction` defined. According to the documentation, "you must specify the claims you require using the `MapUniqueJsonKey` method", which means that any claims that are present only in the UserInfo response and don't have a corresponding `ClaimAction` are ignored.
|
Thanks for the PR. I finally got authelia installed and the PR is working. Will see how this can be generalized and ensure that this does not break other SSO providers. |
|
As far as I understand, this behavior is generic and not Authelia specific. As long as OIDC provider returns claims of interest only in the UserInfo, you must set
Which means that if OIDC provider returns everything that we need in the ID Token, The only thing that might need tweaking is the list of claims that are tested in the UserInfo. I.e., the |
I think that I finally found a solution for #1894.
For claims to be extraced from the UserInfo response, they must have corresponding
ClaimActiondefined. According to the documentation:Any claims that were present only in the UserInfo response (which was the case with
preferred_usernameandgroups) and didn't have a correspondingClaimActionwere ignored. This also explains why, after creating a user and disabling the workaround, I was still able to login -namewas still present and used for matching a user.PS: Last time I touched .NET was in university, so I have no idea about the conventions and best practices. Feel free to refactor the code, if needed 😄