-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to read non-standard claims from OpenID IdP #15808
Comments
@cbadger-montecitobank Did you check the options That would ensure that your script has effect on the process. With that enabled + your script If the external server assign I also think you'll need Role scope needs to be allowed to ensure that the server share the role with your OC app. |
@MikeAlhayek appreciate your response. Yes, my login script is enabled, and it definitely runs. I can add log statements to output the contents of the I've also added "roles" to my list of scopes, among other scopes that contain additional claims. Sadly this doesn't result in any of them appearing in the |
@cbadger-montecitobank if you are able to replicate the issue into OC solution, you should be able to debug it. The following code is what evaluates the OrchardCore/src/OrchardCore.Modules/OrchardCore.Users/Handlers/ScriptExternalLoginEventHandler.cs Lines 50 to 58 in 05bc02b
At that point, RolesToAdd should have correct records and RolesToRemove should not have anything. The results are then called and added to the User here OrchardCore/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs Lines 319 to 320 in 05bc02b
|
@MikeAlhayek I'm able to replicate the issue in the OC solution and debug. The login script runs, and if I have it add something to the I've traced the code back up to the
Inspecting Appreciate the help! |
@kevinchalet at what point in OpenIddict we populate the external login claims? What could be preventing these external claims from coming through? |
@MikeAlhayek OpenIddict is not used for the client part of the OpenID module (there are plans to change that, but we'd like to use the secrets module for key management: #14021). @cbadger-montecitobank are you sure the claims are not mapped to their WS-Federation/ |
I'm not sure if this is a bug, feature request, or just my misunderstanding of how Orchard's OpenID integration works. I'm successfully using the OpenID Client module to log into Orchard using Identity Server as the external provider. It returns some standard claims (e.g. name, email, etc.) that Orchard recognizes and uses to register and log in the user. So far so good.
The problem arises when I try to read other (non-standard?) claims returned from Identity Server within the user login script, with the hope of using those claims to make decision about which Orchard roles the authenticating user should belong to. These additional claims are not in the
context.ExternalClaims
collection where I'd expect them to be.At the very least I was hoping Identity Server could provide "role" claims that I could read and use to set the user's Orchard roles. Being able to read any claim coming back from Identity Server would be even better.
Below is my login script, which looks for a claim of type "role" with value "AdminRole", but it never finds one. For debuggin, I've logged the entire contents of
context.externalClaims
to see if it contains any role claims, but it does not.I've confirmed that I'm requesting the appropriate scopes that would result in the desired claims being included in the Identity Server response. Requesting the same scopes from another application, using the same configured clientid, shows the claims be returned.
Any help would be appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: