FAQ Database Discussion Community

getting Roles that already set to custom Authorization attribute?

I customized the authorize attribute of Asp.Net but I do not know how to get the roles which I set to the attribute when I set the attribute to a method or class For example I have this CustomeAuthorizeAttribute [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class CustomeAuthorizeAttribute : AuthorizeAttribute { protected override...

ASP.NET Identity “Role-based” Claims

I understand that I can use claims to make statements about a user: var claims = new List<Claim>(); claims.Add(new Claim(ClaimTypes.Name, "Peter")); claims.Add(new Claim(ClaimTypes.Email, "[email protected]")); But how should I store "role-based" claims? For example: The user is a super administrator. claims.Add(new Claim("IsSuperAdmin, "true")); The value parameter "true" feels completely redundant. How...

About windows authentication

I enabled windows authentication for asp.net mvc project. I'm in company domain, and when I send an get request to server side, I don't see any special stuff like username/pwd in header/body. How does server know who am I? And if I send an ajax call to server, do I...