Questions tagged [asp.net-roles]

ASP.NET role management helps you to manage authorization, allowing you to specify which resources various users in your application are allowed to access. Role management lets you group users by assigning them to roles.

226 questions
1
vote
2 answers

ASP.Net Membership logging in successfully, then redirecting to login page

We're having a load of problems with an ASP.Net Membership application at the moment. For reasons that aren't relevant, we're using a MembershipProvider implementation that uses the old-style Web.config specified credentials and a RoleProvider that…
1
vote
0 answers

Roles in Asp.net mvc template not redirecting second time

I have created an mvc template application with role based authorization. When a user clicks on an action method meant for him(say About), he is redirected to the About view. But problem occurs when he clicks to another page(ex-home page) then comes…
It's a trap
  • 1,333
  • 17
  • 39
1
vote
1 answer

How do I code a RoleProvider against a datastore that doesn't define roles?

I'm looking at writing a custom RoleProvider to talk to an external third-party system. However, the "roles" I need aren't explicitly defined in the system but are instead based on conditions within the system. For example, a role might be defined…
Peeyotch
  • 33
  • 4
1
vote
1 answer

Roles.IsUserInRole Not working - Role not enabled Identity

Hoping someone can assist this has been a challenge. I am new to the Identity "way" of doing member login so please be patient. login, register all work fine when I login, I would like to see if the user is admin or not If Not…
ookie
  • 138
  • 11
1
vote
1 answer

How do I prevent duplicate membership users when using multiple roleproviders with different application names?

I have a single membership provider which is using the '/' default application name. I then have multiple applications which share this common membership provider configuration. Each application has it's own role provider configuration, they all…
Brian Scott
  • 9,221
  • 6
  • 47
  • 68
1
vote
1 answer

How to Override base functionality of UserManager.GetRolesAsync(TKey userId)

The base functionality for GetRolesAsync(TKey userId) is the following public virtual async Task> GetRolesAsync(TKey userId) { ThrowIfDisposed(); var userRoleStore = GetUserRoleStore(); var user =…
DRobertE
  • 3,478
  • 3
  • 26
  • 43
1
vote
1 answer

Roles class asp.net mvc?

where the Roles class store the roles that he creates, what is the type of role providers that support this class? is it SqlRoleProvider?
user3284079
1
vote
1 answer

ASP.NET Roles not being assigned to users

I have a site that I want to differentiate between ASP.NET Identity users and External Users using roles. I have created my roles using: ApplicationDbContext.Roles.Add(new IdentityRole() { Name = "External" }); …
Jake
  • 1,207
  • 2
  • 28
  • 46
1
vote
3 answers

Extending the RoleProvider GetRolesForUser()

The GetRolesForUser() method in the RoleProvider takes the user login name and returns the list of roles for that user. But in my application this is not enough, I need a few more pieces of information to be able to get the user's roles. How can I…
1
vote
1 answer

Is ASP.NET membership, role management and Profile usable in a C# Class Library?

I know it's possible to use this information in a winform, wpf or console application. But I rather to determine which user with what roles are running a sepecific method, so I could decide upon them and run different codes. In addition in a desktop…
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
1
vote
1 answer

How to use user.context object for CRM Users in ASP.NET MVC

I'm consuming a WCF Webservice with CRM Backend. All the users are stored in CRM. User can have different roles e.g. Supervisor, Team Leader etc. I would like to use the asp.net User.Identity.Name or User.IsInRole etc. Could someone please advise…
Nil Pun
  • 17,035
  • 39
  • 172
  • 294
1
vote
3 answers

IsInRole Works only when user sign in

Why HttpContext.Current.User.IsInRole("Customer") returns false if the user is not logged in, I think because user is considered anonymous is this case, Correct? Thanks
Costa
  • 3,897
  • 13
  • 48
  • 81
1
vote
1 answer

Where to implement extra business logic on authorization?

I am creating an ASP.NET MVC application and this is my problem: When accesing an action in controller, beside checking if logged user in in allowed role with Authorize attribute, i need to include logic conserning if user i want to edit(it's id…
Martin
  • 404
  • 1
  • 5
  • 15
1
vote
1 answer

Roles Create New DataBase When I Add a user to a role in MVC 5

i create my own database and add user identity table to this by change the connection string. now my connection string is this: when i create a new user it worked well. but when i change the Register(RegisterViewModel model) in …
1
vote
1 answer

How are role cookies encrypted?

FormsAuthentication has an encrypt and decrypt method to push and pull the Authentication Ticket. Roles has a lot of the same methods, but it does not tell you what type of encryption is being used, or how to decrypt it. Can anyone point me in the…
Recursor
  • 542
  • 5
  • 18