Why Aren't Multiple Identities Allowed on the ClaimsPrincipal? #176
Unanswered
msaldaco
asked this question in
IdentityServer
Replies: 1 comment 5 replies
-
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was working on tenant impersonation (where the all user information stays the same except for their tenant information) and attempted to enhance the current
ClaimsPrincipal
by adding a new identity to it with the impersonated tenant data. I chose that approach because I thought it might be cleaner, made it easier to avoid polluting the originalClaimsIdentity
, and would make it easier to more easily separate identity data between client apps making use of the same user session from the server. I then discovered that multiple identities aren't allowed by the Duende framework.Is there a reason for not allowing more than one identity? I only found two places it checks for this, one in
GrantValidationResult
and the other inIdentityServerAuthenticationService
but all the comment said was:Is it due to potentially causing side effects in identity's logic regarding how it uses the
ClaimsIdentity
?Beta Was this translation helpful? Give feedback.
All reactions