-
Notifications
You must be signed in to change notification settings - Fork 58
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
How to use Group to Authorize #10
Comments
The handshake, in this instance, is still at the Role level. I imagine any of the areas you mention could be used to modify it for this purpose. However, this was only ever a "poor-man's" quick-and-dirty grouping mechanism. In this case, the authorization "permissions" are still based on Roles, but roles can be grouped. I suspect ultimately better results could be achieved by moving to claims-based auth. |
I get that. I started approaching it a similar way. In fact, calling I got only so far with that approach under those assumptions when I bumped into pervasive assumption that It's also interesting to note, the MSDN does make the statement, "Think about claims the same way you think about attributes in a central repository such as Active Directory, over which you have little control. Security tokens can contain claims such as the user's name, email address, manager's email address, groups, roles, and so on", but I am not certain at the moment what they mean by modeling "groups", as it were. Which I suppose is that the application service(s) themselves are the "provider" making the claim? Not sure yet. The thing I don't like, detest it, is that Authorize is hard coding Roles as comma-delimited string literals. Surely there must be a better way to capture that. I haven't read more deeply into that, yet. |
Thoughts on public class UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim> : IUserLoginStore<TUser, TKey>, IUserClaimStore<TUser, TKey>, IUserRoleStore<TUser, TKey>, IUserPasswordStore<TUser, TKey>, IUserSecurityStampStore<TUser, TKey>, IQueryableUserStore<TUser, TKey>, IUserEmailStore<TUser, TKey>, IUserPhoneNumberStore<TUser, TKey>, IUserTwoFactorStore<TUser, TKey>, IUserLockoutStore<TUser, TKey>, IUserStore<TUser, TKey>, IDisposable
where TUser : Microsoft.AspNet.Identity.EntityFramework.IdentityUser<TKey, TUserLogin, TUserRole, TUserClaim>
where TRole : Microsoft.AspNet.Identity.EntityFramework.IdentityRole<TKey, TUserRole>
where TKey : System.IEquatable<TKey>
where TUserLogin : Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<TKey>, new()
where TUserRole : Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<TKey>, new()
where TUserClaim : Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<TKey>, new() I could be wrong. I'd like to back out of the EF stuff and just roll my own extensible Identity model, including the claims. |
I see in a couple of spots where you call out
"Admin"
for purposes of Role-based Authorization. But I do not see where you incorporateGroup
in any authorization handshakes. Have I missed something, or is that handshake TBD? Via the AuthorizeAttribute mechanism? Or other Startup request pipeline?The text was updated successfully, but these errors were encountered: