roleprovider

IsUserInRole Error with SimpleMembership

拥有回忆 提交于 2019-12-11 03:34:02
问题 I use this codes for Role Authorization on my ASP.NET MVC 4 Internet Application.. @if (Roles.IsUserInRole("RolunAdi")) { <a href="#">Test</a> } It works normally but sometimes I have an error.. It is on the this image.. http://forum.yazgelistir.com/JS/HTMLEditor/Image.aspx?id=593&siteid=0 I have 2 things in my mind.. First; I have two connection string in web.config.. First for entity framework data model, second for SimpleMembership.. (By the way what can I do for use only one connection

Manage user access to pages in ASP.NET

[亡魂溺海] 提交于 2019-12-10 20:18:35
问题 I am using MembershipProvider and currently a have 3 roles: User, Super User, Admin. Also I have pages that can be seen only by Admin and Super User. For these pages a I use configuration in web config: <location path="Users.aspx"> <system.web> <authorization> <allow roles="Admin, Super User"/> <deny users="*" /> </authorization> </system.web> </location> And this works perfectly fine. But I have bunch of pages Evaluations Actions Reports Files to which a I want separate access. I want grant

Custom role provider does not implement inherited abstract member

六眼飞鱼酱① 提交于 2019-12-10 19:09:33
问题 I need some help implementing a custom role provider in a asp.net mvc app. The problem is that I'm getting several errors like: MyRoleProvider does not implement inherited abstract member 'System.Web.Security.RoleProvider.RoleExists(string) I get the same error for other methods. However, I do have implementations for those... My web.config has this: <roleManager enabled="true" defaultProvider="MyCustomProvider"> <providers> <add name="MyCustomProvider" type="MyRoleProvider" /> </providers> <

umbraco public access error when authenticated

断了今生、忘了曾经 提交于 2019-12-10 16:01:10
问题 I have an issue with public access in Umbraco 7. I use a custom membership provider to authenticate the users by my CRM database. I set a rule to let access to authenticated (front-end) users only and I used a custom role provider to define authenticated users have the visitors role. If they are not authenticated, they are redirected to the login page. When I debug the website the user has the role : I am authenticated and the role for the current user is the good one. But I am still

Handling Nested Group Permisions (ASP.NET Role Provider)

自作多情 提交于 2019-12-10 12:19:43
问题 We have a security module which, based on group/role membership, controls permissions to resources in ASP.Net. I've built a custom ASP.Net Role Provider that queries Active Directory for group membership and which is used by this module. Security checking works as follows for each request (caching used in places for performance reasons but excluded from this list): Query AD for list of users group memberships Query database for a list of users and groups with access to the requested resource

Cannot login with new password after resetting using SqlMembership Provider

瘦欲@ 提交于 2019-12-08 12:25:11
问题 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 encrypted value is stored inside the table. But unable to login. My webconfig setting: <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"> <providers> <clear /> <add name="SqlProvider" type="System.Web.Security

How to use both windows and forms auth with a single custom role provider

☆樱花仙子☆ 提交于 2019-12-08 12:18:21
问题 I have a custom role provider, built on a Role entity, and a many to many relationship called RoleUser, between my forms auth User entities and the Roles. I would like to switch this roles provider into using Windows auth as well now. It seems convenient for me piggy back of the forms Users, and create 'shadows' of AD users in my Users entities. Is this feasible or frowned upon, and are there any good papers etc. on this kind of setup? I'm using EF Code First against SQL 2005, and am not

Extending the RoleProvider GetRolesForUser()

爱⌒轻易说出口 提交于 2019-12-08 08:34:55
问题 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 get this extra information into the method? I have it in the Session , but I found out that Session is not available in the RoleProvider . What I had in mind was putting this extra info in some class that extends MembershipUser , assuming I can get

ASP.NET Role Provider vs Membership Provider

混江龙づ霸主 提交于 2019-12-08 07:52:02
问题 Please refer to this post. I have become able to configure my web.config file so that when an unauthenticated user requests a page, he is redirected to the Login.aspx page. I have been able to do that by configuring web.config file and the following few lines of code: protected void btnLogin_Click(object sender, EventArgs e) { string username = this.usernameTextBox.Text; string password = this.passwordTextBox.Text; bool success = Membership.ValidateUser(username.Trim(), password.Trim()); if

Refresh ASP.NET Role Provider

我只是一个虾纸丫 提交于 2019-12-07 12:16:14
问题 simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is there any way in which I can somehow "refresh" the provider without forcing the user to log out of the site and log back in? I'm looking for something that would be akin to a fictional method Roles.Refresh() Specifically, I am looking at this for if an administrator changes a user's roles, the user sessions could maybe refresh themselves every 10 minutes or something. 回答1: I assume you have something like