Closed the-black-wolf closed 2 years 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.
I wanted to add a custom identity resource instead of a really large profile one and with the claim I need:
I added it to resources and to the applicable client:
I've setup my
IProfileService
implementation, however, when the token is requested and the code entersGetProfileDataAsync
, thecontext.RequestedClaimsType
is empty. Enduser logged in with requestedbilling
scope and the database entry in grant storage reflects this.I've debug this a little and found this code here:
https://github.com/IdentityServer/IdentityServer4/blob/3ff3b46698f48f164ab1b54d124125d63439f9d0/src/IdentityServer4/src/Services/Default/DefaultClaimsService.cs#L113-L217
Apparently, the
additionalClaimTypes
, which is later filtered before passing toGetProfileDataAsync
, is only constructed from ApiResources and ApiScopes. Identity resources are completely ignored.Is this a bug or a desired functionality (why skip custom identity claims?), and if so how do I dynamically adjust profile service to detect if I should set 'name' and
billing_account_number
claims. I see thebilling
scope name listed incontext.RequestedResources
, but its just there by name, I fear the future moment where this might change and cause a disconnect between client setup and a profile service, I would much rather like to dynamically respond to requested claims rather than assume things. In the samples on the internet, people mostly just have one client and an always-requested scope so they just blindly force claims into result. We will only needbilling
for clients which deal with user's billing.