FAQ Database Discussion Community


About windows authentication

asp.net-mvc,asp.net-mvc-4,authentication,asp.net-authorization,asp.net-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...

ASP.NET Identity “Role-based” Claims

asp.net-identity,asp.net-web-api2,claims-based-identity,asp.net-identity-2,asp.net-authentication
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...

getting Roles that already set to custom Authorization attribute?

asp.net,asp.net-authorization,asp.net-authentication,custom-authentication
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...