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

Error using Roles.IsUserInRole in Razor

I'm working with MVC 5 and I have the following code in my View: @if (Roles.IsUserInRole("admin")) {
  • MikePR
    • 2,786
    • 5
    • 31
    • 64
  • 0
    votes
    1 answer

    Is it possible to block a page from opening using securityTrimmingEnabled=true

    I have custom SiteMapProvider and RoleProvider that works together properly: IsAccessibleToUser returns false if current user's role isn't mentioned in SiteMapNode.Roles for page requested. So breadcrumbs or menu doesn't show an item. But user still…
    0
    votes
    1 answer

    Authorise attribute using active directory role provider MVC4

    I am currently using the AspNetWindowsTokenRoleProvider to provide the authorization for my controller actions: [Authorize(Roles = "domain\\group")] public ActionResult Index() { code..... } Rather than hard code the role name ("domain\group"), or…
    0
    votes
    1 answer

    WSAT Security tab error for Custom Role provider

    I have created custome Membership Role and Profile provider using INGRES db. Now I can see my IngresMembership and IngresRole provider in the Provider tab(Select a different provider for each feature (advanced) ) of WSAT but when I clik on security…
    shesb
    • 1
    0
    votes
    1 answer

    Custom Role Provider with Windows Authentication

    We have a custom role provider in an ASP.NET web forms intranet site. We have made sure to have this class inherit from RoleProvider and implement the appropriate methods. However, it is clear that its methods are not being called, including…
    LukeGeneva
    • 584
    • 1
    • 3
    • 15
    0
    votes
    1 answer

    con't create new user in ASP.NET website administration tools

    When I try to create a new user by clicking on 'Security > Create User' I got the following error message : Also for creating a new role : it identified the new user that is created by ASP:CreatUserWizard, so it is connected to database :
    SalmanShariati
    • 3,873
    • 4
    • 27
    • 46
    0
    votes
    2 answers

    Is there a way to call custom method of Custom Role Provider class

    I have created my own custom role provider class "SGI_RoleProvider" and configured properly. Everything is working fine. Suppose that I have added a public method say "SayHello()", then how can i call that. Because if i am using Roles then the…
    IrfanRaza
    • 3,030
    • 17
    • 64
    • 89
    0
    votes
    1 answer

    Cannot login with new password after resetting using SqlMembership Provider

    After resetting the password using SqlMembership provider.I am unable to login with the new password. Below is the line of code used to reset the password for dbo.aspnet_Membership table. Password is encrypted . Everytime I reset the password a new…
    0
    votes
    0 answers

    Where is the ActiveDirectoryRoleProvider class?

    I´ve read in MCT Trainer Handbook of course 20486: Role Providers in ASP.NET 4.5 ActiveDirectoryRoleProvider. This provider class is defined in the System.Web.Security namespace, and the provider enables you to use Active Directory as the…
    0
    votes
    1 answer

    Extending ASP.NET role providers

    Because the RoleProvider interface seems to treat roles as nothing more than simple strings, I'm wondering if there is any non-hacky way to apply an optional value for a role on a per-user basis. Our current login management system implements roles…
    Quick Joe Smith
    • 8,074
    • 3
    • 29
    • 33
    0
    votes
    1 answer

    Dynamic access to actionresults

    Allow users with roles to access controller methods dynamically. I have a typical scenario where I want to allow users to access the pages dynamically as the prvilege set to each roles can be change by a userinterface. I have three actionresult…
    0
    votes
    1 answer

    Roles.GetRolesForUser always takes admin as username

    I have following code in controller for login validation: SecurityProvider securityProvider = new SecurityProvider(); if (securityProvider.ValidateUser(UserName, Password)) { FormsAuthentication.SetAuthCookie(UserName.ToString(), false); if…
    Krishna Sarma
    • 1,852
    • 2
    • 29
    • 52
    0
    votes
    1 answer

    How do I stop a custom EF-based RoleProvider from caching results?

    I have an ASP.NET MVC 4 application which was required to use a pre-existing membership model of users/roles. The way I did this was to implement a custom ASP.NET RoleProvider to manage access, this uses Entity Framework repositories to read user…
    Lee D
    • 12,551
    • 8
    • 32
    • 34
    0
    votes
    1 answer

    Custom Role Provider for Identity Framework

    I want to get some idea for Creating CustomRoles whenever user login to the application. I have Feature Model that looks like as follows: public class Feature : AuditableEntity { [Display(Name = "Code")] [MaxLength(50)] …
    0
    votes
    1 answer

    Injecting HttpContext.Current in MVC Role Provider

    I have a class in my MVC5 application that deals with some user related functionality and has a dependency on HttpContext.Current.User as shown below public interface IUser { // return roles of currently logged in user string[]…
    user1625066