I'm working on a custom membership provider and a custom role provider.
I have added it to the web.config, and I can login and get the roles for my user. But what I can not do, is to make the umbraco pages to recognize the roles that the user have.
I have created a role based access on a page, and if I go the page I get the login window as I should. It seems that I can login with my user. But when I do, it doesn't change the content on the site from the loginpage to the real site. So it seems that I don't have access.
If I do this:
@{
var curUser = Membership.GetUser();
}
@if(curUser != null) {
<p>Username: @curUser.UserName</p>
}
<p>Roles:</p>
@foreach(var role in Roles.GetRolesForUser(curUser.UserName)) {
<p>Role: @role</p>
}
I get my username and the rolename outputted correctly. So why will Umbraco not grant me access the page content?
Hi, I have the same problem after upgrading from Umbraco 7.02 to 7.1.4.
I have tried inheriting from both the new Umbraco.Web.Security.Providers.MembersMembershipProvider/MembersRoleProvider, and the deprecated umbraco.providers.members.UmbracoMembershipProvider/UmbracoRoleProvider.
Seems like a bug (or a breaking change, but I can't find any info about that).
I was just writing about this myself. I'm also getting the same issue. Custom Membership. Log in, role exists, user exists but Umbraco seems to be ignoring it (exactly the same as Peter is experiencing). The exact same code has previously worked great for earlier versions of Umbraco (versions 4.5 - 4.7).
Is this a bug? Or is there a newer way to write custom membership in 7.1.x (I'm using 7.1.8).
Just like Conny, I can't find any information about this.
Custom Membership- & RoleProvider to secure pages
Hi people
I'm working on a custom membership provider and a custom role provider.
I have added it to the web.config, and I can login and get the roles for my user. But what I can not do, is to make the umbraco pages to recognize the roles that the user have.
I have created a role based access on a page, and if I go the page I get the login window as I should. It seems that I can login with my user. But when I do, it doesn't change the content on the site from the loginpage to the real site. So it seems that I don't have access.
If I do this:
I get my username and the rolename outputted correctly. So why will Umbraco not grant me access the page content?
Cheers
Peter
I wrote this before the holidays... Still having the same problem!
Would it be any less secure if I did something like this:
That was the way I did with classic ASP in the old days ;) Or could there be some secure issues here?
Cheers
Peter
Hi, I have the same problem after upgrading from Umbraco 7.02 to 7.1.4.
I have tried inheriting from both the new Umbraco.Web.Security.Providers.MembersMembershipProvider/MembersRoleProvider, and the deprecated umbraco.providers.members.UmbracoMembershipProvider/UmbracoRoleProvider.
Seems like a bug (or a breaking change, but I can't find any info about that).
What Umbraco version do you use?
I was just writing about this myself. I'm also getting the same issue. Custom Membership. Log in, role exists, user exists but Umbraco seems to be ignoring it (exactly the same as Peter is experiencing). The exact same code has previously worked great for earlier versions of Umbraco (versions 4.5 - 4.7).
Is this a bug? Or is there a newer way to write custom membership in 7.1.x (I'm using 7.1.8).
Just like Conny, I can't find any information about this.
Thanks
Really old post but i am kind of stuck here too, could someone push me in the right direction?
is working on a reply...