- ABP Framework version: v5.3.0.RC3
- UI type: Blazor WASM
- DB provider: EF Core
I am using Azure AD to authenticate and I pull a custom claim "Country"
I want to use that custom claim all over the application, and I also want it to be used for AUTO Filtering Data at the Repository Level.
what are the best options to enable this requirement using ABP functionality and core extensibility
4 Answer(s)
-
0
To use Data Filtering,
Country
should be a property in your Entity. It should be an existing field to be queried on the database level.What will you use the custom claim against on the database? I suppose there is a corresponding field in an entity to check this field.
Can you explain more about your intentions like how do you implement
ICountry
or how do you want to query? -
0
in the DB there is a list of ITEMS that have COUNTRY field.
when a user authenticates with Azure AD I would like to pick up Country claim from their profile and auto filter the list of ITEMS based on the Country field matching the user profile.
this functionality is currently what am looking for, it’s not implemented yet I am exploring the following:
- Custom Claims
- IdentityUser ExtraProperties
- ICurrentUser
- Custom Data Filters
-
0
It seems like a business logic with multiple ways to achieve it.
You can add
ICountry
marker interface for Items and add a custom data filter checking ifICurrentUser
has the country custom claim when the user logs in. -
0
ok thank you.