IdentityServer4.Admin
IdentityServer4.Admin copied to clipboard
User Claims not added to token even if Always Include User Claims In IdToken is set
I have some custom User Claims on a user and I set the User Claims not added to token even if Always Include User Claims In IdToken
to true. I expected that now these claims will be part of the token. But they are missing.
If I add the claim name (in my case initials) to the Profile Identity Resource I receive the claim in the token.
I have only worked with a ID4 server directly without the Admin UI before. There I created my own profile service and added the claims. And when I set AlwaysIncludeUserClaimsInIdToken = true
in the Client config I got my User Claim.
Does Admin UI Work differently here?
Thanks for all the work you put in this...
In order to receive the claims in your client you still need an Identity Resource with the custom claims you created and add a scope to your client that matches it. Did you do that? The fact that when you add the claim to an existing Identity Resource it works makes me think you're just missing that step.
@aiscrim I added user claims to "openid" identity resource as you said and it worked. Thank you for your comment, it helps me a lot.