Questions tagged [roleprovider]

Built-in and custom implementations of ASP.NET's Role Provider, as part of Membership functionality in the System.Web.Security namespace.

ASP.NET supports user authentication and authorization through a provider-based model. In support of the authorization providers, there is a Role Provider which supports filtered access to resources by checks against pre-assigned roles.

MSDN Documentation

Managing Authorization Using Roles

Understanding Role Management

Role Management Providers

ASP.NET Security

Questions for this Tag

Questions that should have this tag pertain to use of the default ASP.NET Role Providers (AspNetSqlRoleProvider & AspNetWindowsTokenRoleProvider), as well as questions about extending/overriding the built-in provider.

386 questions
4
votes
1 answer

Using WebSecurity with NHibernate and Postgresql?

Since I want to use Postgresql and NHibernate in my ASP.NET MVC4 project, I am wondering if it is possible to use the WebMatrix.WebData.WebSecurity for security and authentication features? NHibernate and Postgres are working already together, but…
core
  • 851
  • 1
  • 8
  • 28
4
votes
3 answers

Is it possible to use ASP.NET MembershipProvider/RoleProvider in self-hosted WCF services?

I am trying to use custom ASP.NET MembershipProvider and RoleProvider to handle security for my service. The service is self-hosted in a console app, not in IIS. I use webHttpBinding with Basic Authentication. I configured serviceCredentials and…
4
votes
1 answer

Accessing authorization information in web.config

I'm writing a custom role provider and I need programmatic access the authorization information stored in the web.config. Certain section of the site are only accessible by certain roles. I would like to find out which roles can access a page…
kareem
  • 753
  • 1
  • 5
  • 10
4
votes
2 answers

Make a Role that always is authorized even when not listed

In MVC3 is there a way to make a role (SuperAdmin) that is ALWAYS authorized even if not explicitly listed in the Roles list? For example with this markup... [Authorize(Roles="Accounting")] Even though I'm not in the Accounting role, as a SuperAdmin…
Jared
  • 5,840
  • 5
  • 49
  • 83
4
votes
2 answers

RoleProvider dosn't work with custom IIdentity and IPrincipal on server

I'm using a custom IIdentity and IPrincipal in my ASP.NET MVC application via EF 4.3 as expalined here (and follow accepted answer's solution). Also, I have a custom RoleProvider. In local (using IIS Express), it works currectly. But now, when I…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
3
votes
1 answer

Grouping Roles Together & Assigning Users to a Group (ASP.NET Role Provider)

Are there any pre-existing solutions out there which would extend the built in SQL Membership Provider & Sql Role Providers in .NET with the concept of Group Membership. Right now the Roles relationship looks like Users ====> UserRoles…
Eoin Campbell
  • 43,500
  • 17
  • 101
  • 157
3
votes
2 answers

Custom RoleProvider keeps caching my repository object

I've implemented a custom RoleProvider for a project. The RoleProvider works, but the repository I use to fetch the user roles is only populated after build. When I logOff, change the role of the user, logOn again, the user still holds the old…
jpderooy
  • 73
  • 1
  • 5
3
votes
1 answer

Custom RoleProvider Not Called

My application has custom Role and MembershipProviders. I've registered them in web.config, but when I try to do if(User.IsInRole("Blah")), neither of my breakpoints in the RoleProvider's Initialize or IsUserInRole are hit. The membership provider…
Echilon
  • 10,064
  • 33
  • 131
  • 217
3
votes
2 answers

Does the asp.net RoleManager really cache the roles for a user in a cookie if so configured?

In my web.config I have the Role Manager configured as follows:
Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154
3
votes
2 answers

Roles management with no provider?

In my app I need to check the roles for the loggind user to determine if the user could see some controls or not first I use the loginview template from MS but as I don't have the users db neither the roles db So I couldn't add a role provider so I…
AshOoO
  • 1,108
  • 3
  • 13
  • 34
3
votes
1 answer

C# - Forms Authentication Code-Behind w Custom Role and Membership Providers

Unfortunately, all the examples for Forms Authentication Code Behind w/ Custom Role and Membership Providers I find online are written with a VB.NET code behind and I need a C# code behind. Please help!!!! I need a codebehind that will do the…
3
votes
2 answers

asp.net custom role provider nhibernate error

HI, I am implementing a custom role provider in my nhibernate application I have a repository that I call whenever I want to access the nhibernate session. So when my role provider initializes itself public override void Initialize(string name,…
Para
  • 2,022
  • 5
  • 34
  • 73
3
votes
0 answers

User.IsInRole only works with AD Group SID (rather than Group Name)

If I only use Windows Authorization, I can easily use User.IsInRole("Web Developers") without issue. But, when I add a SQL Role Provider, User.IsInRole will only return true (for Active Directory groups) if I use the group's SID. It doesn't seem…
3
votes
4 answers

How can I implement an ID based user system (membership, authorization, etc.) in ASP.NET MVC?

I have been thinking for a good while about how to tackle the problem of implementing an ID based user system while using ASP.NET MVC. My goals, much like StackOverflow's system are as follows: Allow the users to change their nicknames without the…
Kenji Kina
  • 2,402
  • 3
  • 22
  • 39
3
votes
2 answers

Winforms role based security limitations

I'm implementing role based security using Microsoft's membership and role provider. The theoretical problem I'm having is that you implement a specific role on a method such as: [PrincipalPermissionAttribute(SecurityAction.Demand,…
muhan
  • 2,537
  • 3
  • 29
  • 33