-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having issue with permissions and claim #106
Comments
Hi @gigabytem, I suggest you read the article Finally, a library that improves role authorization in ASP.NET Core which explains how the Roles / Permissions. The AuthP library handles the adding the Permissions to the user's claim, and the To answer you question on the Permissions claim contains Unicode characters for all the Permissions that the user. Have a look at the PermissionPacker code if you are interested. PS. If you are using Blazor or other frontend code, then you might find the |
@JonPSmith I'm trying to use AuthP on a WebAPI project and use react as a front end library. I have an endpoint decorated with [HasPermissions(PortalPermissions.Read)] and the user has a role which contains this permission. What's the recommended way to set this up?
|
Hi @SoftAdviceJR, Its hard to diagnose your problem so I will tell you about how the the built-in Azure AD and WebAPI features work to help you to work out what is wrong. And at the end I suggest some extra things that might help. Explaining AuthP's Azure AD featureAuthP has code for Azure AD and an example in the Example5.MvcWebApp.AzureAdB2C app. Adding NOTE: AuthP's Sign up for a new tenant, with versioning doesn't work with Azure AD B2C with social logins. Explaining AuthP's WebAPI featureAuthP has code for WebAPI and an example Your situationYou want to use Azure AD for Authentication and WebAPI to hold the user's claims. Using the AuthP Azure AD and WebAPI features should work (but I haven't tried it). However, you only need the Azure AD user's Id and then the AuthP's WebAPI TokenBuilder's |
I was trying to implement roles and permissions in my project
these are my Permissions
and these are my RolesDefinition
but the permissions are stored in what look like encrypted format (my locale is (IN , eng))
and when I get my token from the user after login , I am getting Permissions claim also in encrypted format.
when I decorate my endpoint with permissions {AquaPermissions.ReadMaster} it is not working
I have to hardcode it as the encrypted format ("ஹஸ" ) for it to work
is it how it is supposed to work ?
The text was updated successfully, but these errors were encountered: