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

ASP.NET MVC Custom RoleProvider cannot retrieve roles from database for username

i cant seem to find the right solution for the above issue. I keep getting System.NullReferenceException: Object reference not set to an instance of an object. i followed this guide…
Aatish Kumar
  • 149
  • 2
  • 15
0
votes
2 answers

Custom Role Manager / Provider

I am trying to implement a custom role manager in an MVC5 application using the following Custom Role Provider Tutorial. I have created my Custom Role Provider overiding the 2 required functions. namespace Models.Security { public class…
0
votes
1 answer

Why am I having this RoleProvider problem?

I currently have 2 simple ASP .Net applications. Both applications share the same aspnetdb membership database for membership, roles and providers and the same encryption and decryption keys. They also have seperate websites and seperate application…
Brian Scott
  • 9,221
  • 6
  • 47
  • 68
0
votes
2 answers

Associations among users in ASP.NET Membership

I want to create associations between users in my application. For instance there is a Program Director (Role:PD) which has many Residents (Role:Resident), similarly there is an APD (Role: Asistant Program Director) to each PD. To each PD I want to…
skhan
  • 45
  • 1
  • 7
0
votes
1 answer

Custom Role Provider. Username not being detected

I have implemented a customer role provider in a C# MVC app. It doesn't seem to be detecting the Windows user. This was working fine yesterday. The config for it looks like this:
CompanyDroneFromSector7G
  • 4,291
  • 13
  • 54
  • 97
0
votes
2 answers

Is it necessary to override the membership and the role providers?

I'm working on a web app and I don't want to store the connection strings in the web or app config because of the requirements. So far I have found the only way to achieve this - to override the membership and the role providers. I also don't…
user338195
0
votes
2 answers

Can't Detect User Role

Using asp.net and c# and visual studio 2010 I have a login page and a login control in it and i'm doing something that when a user try's to login , it will detect the user role. Here's my code : using System; using System.Collections.Generic; using…
0
votes
1 answer

ASP.NET Identity IsUserInRole throws Checkschema error

I am working on User management for my site. 1) I have created a VB.net webforms application in Visual Studio 2013. 2) I ran the site 3) registered a user 4) logged in using that user and all is great. However, when I tried to display a…
0
votes
1 answer

reject user to specific view?

i have mvc2 project and i make custom role Provider I'm using attributes [Authorize(Roles = "Admin")] to prevent an authorized user from doing some actions that always reject user to log in view i want to change that and redirect user to view that…
Khalid Omar
  • 2,353
  • 5
  • 35
  • 46
0
votes
2 answers

Accessing a Custom Role Provider exposed through a Web Service in ASP.NET?

We currently have an application we use to setting up user roles. We have a project in that solution that we use as a reference in several of our other web applications. This project contains a Custom Role Provider that is used by these other web…
Scott B.
  • 1
  • 2
0
votes
1 answer

Why wont my custom role provider update the roles when I change the database?

I am building a small CMS system with ASP.NET MVC and I have a custom role provider using a userRepository instantiated by a factory implemented using Castle Windsor. Someone with admin privileges can change the roles of a user, saved in a…
0
votes
1 answer

Get UserId from custom User Identity class

I am trying to access the UserId property from a custom UserIdentity class that I created, but I am having trouble with the syntax to access it. Here is the class: using System.Security.Principal; using System.Web.Security; namespace…
cfly24
  • 1,882
  • 3
  • 22
  • 56
0
votes
1 answer

ASP.NET MVC 5 Custom Role Provider Not Working?

i have a problem with my custom role providor "string[] GetRolesForUser(string username)" method but the proccess dont go through it. My code is: Controller (Just a piece of it): [Authorize(Roles="Administrator")] public class UsersController :…
kanazaca
  • 28
  • 3
  • 8
0
votes
1 answer

Custom Role Provider not working - Instant redirect to login page after logging in

I have made a custom Role Provider. Before I updated my VS and NuGet packages everything seemed to work. However, when I login now it looks like the pages gets refreshed (or the View is reloaded atleast). I do see a cookie is created though, but I…
Kraishan
  • 443
  • 5
  • 14
  • 38
0
votes
0 answers

ASP.NET API Windows authentication w/o login

Intranet application that needs to use Windows AD for authorization. Anyone will have access to the site, but only members of a specific AD group will have access to certain pages and API calls. The group name is in the web.config as it will vary…
Ryan Langton
  • 6,294
  • 15
  • 53
  • 103