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
5
votes
2 answers

Where does Web.HttpContext.Current.User.Identity.Name come from?

I have FormsAuthentication.SetAuthCookie("someName", True) as part of my custom login sequence. Later, I have some page only allowing a specific role:
Larsenal
  • 49,878
  • 43
  • 152
  • 220
5
votes
5 answers

How to get users not in role,

Is there any reasonably efficient way to get a list of users who are not in a specific role? The only methods I can see are Get all the users from DB and do a check in code Go directly to the db and sidestep the role provider
Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100
5
votes
1 answer

Umbraco 7 custom membership and role providers

I went through 10's of documentation and I am doing the right thing but I am sure it is a small detail I am missing. I want to use my own login mechanism to log in my website. the login mechanism is in an Identity server for single sign on. But I…
dori naji
  • 980
  • 1
  • 16
  • 41
5
votes
1 answer

How to provide dependency injection via StructureMap for a custom role provider with WCF?

We're going to be using a custom role provider with WCF. The overridden method GetRolesForUser will require the use of an already existing RoleRepository. Now, with a run-of-the-mill class, we'd construct it using StructureMap and the…
user129345
  • 453
  • 2
  • 8
  • 19
5
votes
3 answers

Recommendation for third party Asp.Net membership providers

I am working on a web application that has strict security and auditing requirements (HIPPA stuff). So we are evaluating whether we should build our own custom membership and role providers or whether there is a commercially available component…
Mark Arnott
  • 1,975
  • 3
  • 17
  • 28
5
votes
1 answer

Mock default role provider for controller's action unit test

Hope this is not a dumb question. I've been searching for two days a way to mock calls for system.web.security.roles on my actions. I want my unit tests to be isolated and not involve calls to external resources such as database where the roles get…
5
votes
1 answer

Symfony2 in_memory users provider issue

I have a Symfony2 application that loads users from in_memory user provider. The security.yml is the following: security: encoders: Symfony\Component\Security\Core\User\User: plaintext role_hierarchy: ROLE_ADMIN: …
5
votes
1 answer

What are the under-the-hood positive reasons to use the default membership provider or a custom one that inherits it?

I posted this question about 8 months ago. The accepted answer touches on some of the things you would miss out on by not playing by the default provider's rules. For example, if you do not use a custom RoleProvider that inherits from…
4
votes
1 answer

When do asp.net role providers live and die?

I am working with a custom role provider in asp.net and it appears that once the provider is loaded into memory, it doesn't drop out of memory until the web application is restarted (like when the web.config file is changed and saved). Further, all…
Rafe
  • 8,467
  • 8
  • 47
  • 67
4
votes
2 answers

umbraco public access error when authenticated

I have an issue with public access in Umbraco 7. I use a custom membership provider to authenticate the users by my CRM database. I set a rule to let access to authenticated (front-end) users only and I used a custom role provider to define…
Giu
  • 1,832
  • 2
  • 16
  • 31
4
votes
1 answer

Windows Authentication with role does not work when listing user, role takes more priority

I have "mydomain\myusername" in the database with the role Administrator. I have ran a couple of test with different configurations. The comment with the "+" is given access, whereas, the "-" is required to log on. It seems as though a user is…
wirble
  • 151
  • 1
  • 3
  • 16
4
votes
2 answers

Use Multiple ASP.NET Role Providers Simultaneously

I'm developing an ASP.NET system that has two different 'tiers' of roles. The main tier will use Active Directory groups to determine membership, while the second tier will use a database. All users will have a tier-1 AD role, but not all users will…
4
votes
2 answers

How do I configure what happens when using Authorize(Roles) attribute?

I have an MVC4 project with simplemembership configured. It's all working etc. but I would like to know how to tell it wich controller/action to redirect to when a user is not authorized to view a given page. For example, if I use…
Hades
  • 1,975
  • 1
  • 23
  • 39
4
votes
1 answer

Error message does not appear on failed login using asp.net mvc 4 with a custom role provider?

I'm trying to implement a custom role provider and I found a tutorial and followed it. Here is the link: http://techbrij.com/custom-roleprovider-authorization-asp-net-mvc When I try to login using a user account that does not exist, the error…
Randel Ramirez
  • 3,671
  • 20
  • 49
  • 63
4
votes
1 answer

Custom RoleProvider using session

I was considering using the custom MembershipProvider / RoleProviders. Unfortunately, the security layer we currently have requires some session stuff being set. So, when the IsUserInRole() method is called, the Session object is always null, due to…
tim
  • 537
  • 1
  • 5
  • 18
1 2
3
25 26