Which version of Microsoft Identity Web are you using?
E.g. Microsoft Identity Web 1.2.0
Where is the issue?
- Web app
- Web API
- Token cache serialization
- Other (please describe)
This is a new app or an experiment.
Repro
We are attempting to use a custom ClaimAction that will do some additional mapping of JWT claims to custom claims on the identity.
public class CustomClaimAction : ClaimAction
{
public CustomClaimAction(string claimType, string valueType): base (claimType, valueType) { }
public override void Run(JsonElement userData, ClaimsIdentity identity, string issuer)
=> throw new System.NotImplementedException();
}
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(jwt => { }, options =>
{
options.TenantId = Configuration["AzureAd:TenantId"];
options.ClientId = Configuration["AzureAd:ClientId"];
options.Domain = Configuration["AzureAd:Domain"];
options.Instance = Configuration["AzureAd:Instance"];
options.ClaimActions.Add(new CustomClaimAction (ClaimTypes.Role, ClaimValueTypes.String));
});
Expected behavior
I expect the Run method of the CustomClaimAction to be invoked.
Actual behavior
Method is not called.
Which version of Microsoft Identity Web are you using?
E.g. Microsoft Identity Web 1.2.0
Where is the issue?
This is a new app or an experiment.
Repro
We are attempting to use a custom ClaimAction that will do some additional mapping of JWT claims to custom claims on the identity.
Expected behavior
I expect the Run method of the CustomClaimAction to be invoked.
Actual behavior
Method is not called.