Reputation: 803
We're using Okta as our authorization server and we're using scopes as roles for our web APIs. Okta provides the scopes as scp claims, but we need .Net to view the scopes as roles. I can add a custom claim in Okta that duplicates those scp claims as role claims and all works as expected.
Unfortunately, there's some reluctance to add the custom claim to Okta so is there a simple way to have .Net recognize those scp claims as roles?
Upvotes: 0
Views: 622
Reputation: 325
You could use IClaimsTransformation
to map those scp claims to roles. Like this: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/claims?view=aspnetcore-6.0#extend-or-add-custom-claims-using-iclaimstransformation
Upvotes: 0