Replies: 2 comments 4 replies
-
Could you clarify what you don't like about https://joonasw.net/view/adding-custom-claims-aspnet-core-2? When you say "service locator", are you referring to its use of @javiercn Do you have any concerns about the approach mentioned in https://joonasw.net/view/adding-custom-claims-aspnet-core-2, or suggestions for a better way? |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for taking the time to react to my discussion. What I would prefer is having a default implementation of a class where the claims gets constructed and be able to override.
In my case wanting to add claims to the user means inheriting from N.B: The usage of events and service locator is quiet prevalent also in the identity package and the OAuth and I am guessing Cookies. For the sake of harmony whatever is decided must be standard to all of them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application and I am doing authentication against Azure AD (by using the AddAzureAD extension)
I want to do the authorization, but this will be managed locally on the application self.
In the database, based on the username will be assigned some roles.
What I would like to have being able to add the information from the database as claims once the user is authenticated so dat I can use the standard authorization mechanism and alsi be able to call User.IsInRole().
the only way I found at the moment is indicated in this blog: https://joonasw.net/view/adding-custom-claims-aspnet-core-2 but it does not seem satisfying because using a service locator.
is there a way I can easily achieve this that also supports dependency injection?
thanks in advance for your help guys (and gals)
Beta Was this translation helpful? Give feedback.
All reactions