Skip to content

IClaimsTransformation do not automagically compose #46120

@arontsang

Description

@arontsang

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Multiple registrations on IClaimsTransformation should compose. For pete's sake, the signature for IClaimsTransformation is literally an async reduce function.

Describe the solution you'd like

A ReducerClaimsTransformer should be injected into AuthenticationService.Transform

public class ReducerClaimsTransformation : IClaimsTransformation
{
    public async Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal)
    {
        foreach (var transformation in _transformations)
        {
            principal = await transformation.TransformAsync(principal);
        }

        return principal;
    }
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Dev Experiencearea-authIncludes: Authn, Authz, OAuth, OIDC, BearerenhancementThis issue represents an ask for new feature or an enhancement to an existing onehelp candidateIndicates that the issues may be a good fit for community to help with. Requires work from eng. teamuntriaged

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions