Skip to content
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

Access token actor claim is not converted to ClaimsPrincipal Actor #1354

Open
null-d3v opened this issue Apr 28, 2023 · 2 comments
Open

Access token actor claim is not converted to ClaimsPrincipal Actor #1354

null-d3v opened this issue Apr 28, 2023 · 2 comments

Comments

@null-d3v
Copy link

null-d3v commented Apr 28, 2023

Which version of Duende IdentityServer are you using?
6.2.3

Which version of .NET are you using?
7.0.5

Describe the bug
The actor , act, claim on an access token is not converted to ClaimsPrincipal.Actor in IProfileService.GetProfileDataAsync.

To Reproduce
Issue an access token with an actor claim in IProfileService.GetProfileDataAsync for ProfileDataCallers.ClaimsProviderAccessToken:

if (context.Caller == IdentityServerConstants
        .ProfileDataCallers.ClaimsProviderAccessToken)
{
    context.IssuedClaims.Add(new Claim(
        JwtClaimTypes.Actor,
        """{ "sub": "sub", "idp": "idp" }""",
        IdentityServerConstants.ClaimValueTypes.Json));
}

When IProfileService.GetProfileDataAsync executes for ProfileDataCallers.UserInfoEndpoint, the ProfileDataRequestContext.Subject ClaimsPrincipal.Claims are a 1:1 translation of the access token claims. Specifically, the ClaimsPrincipal contains an act claim with a JSON string value.

Expected behavior
I would expect that the actor claim would be applied to ClaimsPrincipal.Actor in this case. I would also expect that this would operate for nested actor claims in the access token, applying to nested ClaimsPrincipal.Actors.

Additional context
I understand the nuances with converting the OAuth/OIDC specs to .NET auth operation models, but this seems an appropriate behavior.

I also understand the ClaimsPrincipal is created from the access token in IdentityModel's Principal.Create. I'm uncertain as to if this would be addressed in IdentityModel or IdentityServer.

@josephdecock
Copy link
Member

Thanks for opening this issue! We'll consider this for a future release. For now, are you able to accomplish what you need with a customized profile service?

@null-d3v
Copy link
Author

null-d3v commented May 1, 2023

Yep, it is just slightly inconsistent and requires a slightly contrived setup.

When issuing claims from the profile service the ClaimsIdentity could have an Actor from the default scheme or an act claim with a JSON claim value type.

@brockallen brockallen transferred this issue from DuendeSoftware/Support Jun 29, 2023
@brockallen brockallen added this to the Future milestone Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants