Closed vamsivallabhaneni111 closed 1 year ago
This organization is not maintained anymore besides critical security bugfixes (if feasible). This organization will be archived when .NET Core 3.1 end of support is reached (3rd Dec 2022). All new development is happening in the new Duende Software organization.
The new Duende IdentityServer comes with a commercial license but is free for dev/testing/personal projects and companies or individuals making less than 1M USD gross annnual revenue. Please get in touch with us if you have any question.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Requirement: Here I have MVC Client request IdentityServer for Id & access token using Auth-Code mechanism.
Infra: .NetCore = 3.1 & IdentityServer4 = 4.1.2 & IdentityServer4.AspNetIdentity=4.1.2
For this I have used 2 types of configurations.
Type1 - AlwaysIncludeUserClaimsInIdToken = true Type2 - AlwaysIncludeUserClaimsInIdToken = false & options.ClaimActions.MapJsonKey() to map the claims. & GetClaimsFromUserInfoEndpoint = true When you see the code below, I have seggregated as 3 layers, first one is Type1 & sceond one is Type2 and common Config is for both Type1 & Type2(as it doesn't vary).
Common Configuration.
Identity Server Proj::
Program.cs //Add Claims when user is created.
startup.cs
1. Type-1 Configuration.
Identity Server Proj::
MyConfiguration.cs //used to configure Identity.
MVC Client Proj::
Startup.cs
2. Type-2 Configuration.
Identity Server Proj::
MyConfiguration.cs //used to configure Identity.
MVC Client Proj::
Startup.cs
Expected result: Id_token with scope employee_id claim (scope of custom.employee_profile).
Actual: Missing employee_id claim in Id_token