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
9
votes
1 answer

Default Role Provider could not be found when using SimpleMembershipProvider

I'm trying to get authorization working on asp.net mvc4, so I try to use WebSecurity. WebSecurity.InitializeDatabaseConnection("tradefairindia", "Users", "Id", "Username", false); I've put this into Global.asax, and this is where the error comes,…
user1534664
  • 3,258
  • 8
  • 40
  • 66
9
votes
1 answer

Does Role Provider cache per request?

My MVC application makes use of a User's Role in multiple places during individual page requests. My question is whether the default SqlRoleProvider caches the current User's Roles for the lifetime of a page-request? For example, I make use of…
Appetere
  • 6,003
  • 7
  • 35
  • 46
8
votes
3 answers

Role Caching Strategies in ASP.NET MVC

We have an ASP.NET MVC application for which we have developed our own custom RoleProvider class. Without caching it will access the datastore for every request - bad. The only caching option we can find is (in web.config) via cookies stored on the…
Chris Arnold
  • 5,753
  • 5
  • 35
  • 55
7
votes
2 answers

ASP.NET MVC 3 Ninject Custom Membership and Role Provider

Hi i got some problems enabling custom Membership and Role Provider, i got following error: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and…
7
votes
5 answers

Why would this catch all block not in fact catch all

The code is fairly simple --- the issue is that there is an invalid character in the groupPath string (a '/' to be exact). What I'm trying to do (at least as a stop gap) is skip over DirectoryEntries that I can't get the cn for --- regardless of…
Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154
7
votes
1 answer

Is RoleProvider not longer available in C# Framework 4.0?

I've a Custom RoleProvider created sometime ago, and wanting to change the library to use the .NET Framework 4. Once changed, I am loosing the reference to RoleProvider class. Has something changed since 3.5 for RoleProvider? It seems to have…
Mark
  • 2,454
  • 4
  • 26
  • 29
7
votes
3 answers

ASP .NET Custom RoleProvider not respecting cacheRolesInCookie="true"

I've implemented a custom role provider, and configured it in my web.config file like this:
Brandon Montgomery
  • 6,924
  • 3
  • 48
  • 71
7
votes
2 answers

How to do authorization in ASP.net MVC 4 today?

I've been working with ASP.net MVC for several years now. Most applications I've developed in the past have been accessed thru a link from a legacy web application. When users arrive on one of my applications, my application simply reads a cookie…
Vivian River
  • 31,198
  • 62
  • 198
  • 313
6
votes
5 answers

Sitemap Security Trimming throws SQL error

I am using the default Sitemap provider with secutiry trimming. But, some how, I get: A network-related or instance-specific error occurred while establishing a connection to SQL Server. I'm thinking the sitemap provider is looking for the roles…
robasta
  • 4,621
  • 5
  • 35
  • 53
6
votes
3 answers

Default Role Provider could not be found on IIS 7 running .NET 4

Good morning all, I am attempting to implement my custom membership and role providers in my web application that I have implemented under the Default Web Site in my instance of IIS 7. My web application is running under a .NET 4 application pool.…
Eric
  • 91
  • 2
  • 9
6
votes
6 answers

Do I need to update all the methods of an abstract class?

I need to inherit from a basic abstract class. I want to override only one method. But Visual Studio oblige me to override them all, So I am overriding more than 10 methods that throw NonImplementedException, I find it stupid. Isn't there any way to…
Younes Ch
  • 325
  • 2
  • 4
  • 14
6
votes
1 answer

Asp.net MVC Role manager

I am using role manager and windows authentication for my asp.net mvc project we have 2 Roles which are viewers and Editors .
Elham
  • 777
  • 1
  • 11
  • 23
6
votes
7 answers

need some idea about how to manage roles in my application (ASP.NET MVC3)

I'm developing some website which is a kind of online workplace, there will be some users and some ongoing computer programming projects, and each user can have multiple roles, for example one particular user can be a project manager for an project…
ePezhman
  • 4,010
  • 7
  • 44
  • 80
5
votes
1 answer

User.IsInRole vs Roles.IsUserInRole in AuthenticateRequest

HttpContext.Current.User.IsInRole is not available in AuthenticateRequest; however, Roles.IsUserInRole is available. Is it because new GenericPrincipal is assigned to HttpContext.Current.User after AuthenticateRequest? Could someone explain me about…
Win
  • 61,100
  • 13
  • 102
  • 181
5
votes
1 answer

Referencing RoleProvider in a class library

I'm trying to create a custom role provider in a class library, and for some reason I can't reference System.Web.Security.RoleProvider. I have added a reference to System.Web in the project, yet still no luck. Is there a reason why I can't do this?
Chris
  • 7,996
  • 11
  • 66
  • 98
1
2
3
25 26