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

How does Custom Role Provider work?

I am going to setup a custom role provider, but I don't have a very good idea of how it works behind the scenes. [Questions] What is the difference between setting roles in a form authentication ticket and using a custom role provider? Which is…
chobo
  • 31,561
  • 38
  • 123
  • 191
0
votes
1 answer

Is there a better way to use Structuremap to inject dependencies into a custom RoleProvider?

I found http://www.devproconnections.com/content1/catpath/database-development/topic/a-perfect-storm-linq-to-sql-dependency-injection-and-asp-net-providers/page/2 and had similar code as from the webpage: public class CustomProvider :…
nportelli
  • 3,934
  • 7
  • 37
  • 52
0
votes
1 answer

ASP.NET MVC 3 with service client as database access layer

I am writing an MVC 3 application, which doens't use the classic approach of accesing the database using the Entity Framework. Instead I have another application combined of WCF Services, which are used to manage the database access. Now I want to…
domderen
  • 633
  • 9
  • 22
0
votes
1 answer

ASP.NET Custom Role provider: Role depending on the context?

I'm starting a new project, and I've a question about Custom role provider with ASP.Net MVC 3. I need to have a role verification for several actions of my constructor, so I said me, okay easy, I can use the role provider. The problem is that the…
J4N
  • 19,480
  • 39
  • 187
  • 340
0
votes
1 answer

Custom RoleProvider: Can't insert record in UsersInRole Table

I have implemented a LINQ to SQL based RoleProvider, when I assign role to a user following exception is thrown while AddUsersToRoles method is called. I have defined a composite primary key userid & roleId on this table, it still throwing this…
mahr.g.mohyuddin
0
votes
1 answer

Update role with aspnet membership provider

I have a RadioButtonList "chklRoles" which has 4 buttons. I want to update database aspnet_UserInRoles if I select a role. But it seems that the Aspnet Membership Provider doesn't have an update method. How can I do it? protected void…
user1108948
0
votes
1 answer

ASP.NET Membership provider SQL Server Express

Is there any problem with using ASP.NET Membership via SQL Server Express ? When I use this code : Roles.AddUserToRole("shah", "Admdin") I am faced with the error shown below. Config : OS : windows 7 64 bit. SQL Server version: SQL Server…
Shahin
  • 12,543
  • 39
  • 127
  • 205
0
votes
1 answer

Allowing access to an MVC site using Windows Authentication Via groups via username

I have an MVC2 site that now allows access to it via windows authentication and uses ASP.net Role provider to provide authorization. I am trying to come up with a way for the site to allow the user access to the site if his username is a member of…
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
0
votes
1 answer

To what extent does my custom sql role/membership provider have to conform to the samples?

I'm using the membership and role provider code from the Microsoft SQLProvider and SQLRoleProvider samples, and I'm getting a little overwhelmed with exactly how I can integrate my own schema into the source. The GetAllUsers method, for example,…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
0
votes
1 answer

C# roleprovider. getallroles() method is overriding Var userdetails= HttpContext.Current.GetOwinContext().Authentication.User.Claims;

I am using SSO in my login page and while authenticated by okta and receiving user claim details, the code is not working correctly, instead the control is taken next to existing role provider class. Ienumerable userdetails=…
0
votes
1 answer

500.19 Error from custom MembershipProvider

I have written a custom Membership Provider and Role Provider and locally these work great. They are pulling all the correct data and writing correctly. However, when i deploy this project to the web server; I receive a 500.19 error pointing to…
Bill Bonar
  • 1,017
  • 2
  • 10
  • 22
0
votes
2 answers

ASP.NET Role Manager Feature Has Not Been Enabled

I'm trying to create a routine in my asp.net's main page that will see if the current user is a member of a Windows domain group. The site is hosted in IIS and is visible through our intranet. GlenFerrieLive listed this code (which I'd like to use)…
user724198
0
votes
2 answers

apt.net membership provider not using fixed configuration

In the membership provider there are mechanics to provide athentication and authorization at the page level using the web.config files and protection for methods using decorators. I am pretty new to using this asp.net…
0
votes
1 answer

Problem with Nebular NbRoleProvider in production mode

This is my role.provider.ts: import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import { map } from 'rxjs/operators/map'; import { NbAuthService, NbAuthJWTToken } from '@nebular/auth'; import { NbRoleProvider…
0
votes
1 answer

Where to stick the configuration of Custom Provider in ASP.NET that implements ProviderBase?

I am trying to figure out a small dillema. I have a piece of functionality that is not supported by the SqlMembership, SqlRole, and SqlProfile providers. The requirements call for using the EF, and also multiple custom features within both the…