Hi!
You could try changing the authorization settings in your site's configuration file. Look for the <location path="path/to/your/ui"> section and change
<authorization><deny users="*">
to
<authorization><allow users="*">
You may also have to do the same for the location section for the path to your admin mode, should be nearby the UI one (<location path="path/to/your/ui/CMS/admin">). Then it ought to be possible to access the admin mode without actually logging in, and you could see if you can set things right from there.
Hope I understood your problem correctly.
Cheers!
//Mathias
Sometimes I get requests that user cannot log in or doesn't have permission to access certain pages.
Why I do is to create a new admin user and then check permissions in admin mode.
1. Enable SQL Server role and membership provider.
2. Create Backdoor.aspx with the following code:
<%@ Page Language="C#" AutoEventWireup="true" %>
<% var user = Membership.CreateUser("someusernmae", "somerpassword", "someemail");
user.IsApproved = true;
Roles.AddUserToRole("someusername", "Administrators");%>
3. Navigate to yourdomain/backdoor.aspx
4. Enter the admin mode as "someusername" and set correct permissions
5. Remove "someusername" and delete Backdoor.aspx from the system
Hope it helps :)
Hello Dejan!
I tried your version of it but I cant navigate to Backdoor.aspx.
I'm currently in a MVC application but I can still create an Aspx page. But when I try to locate http://localhost:37002/Views/Backdoor.aspx it says:
So I can't access the page ._.
Hi Alexander,
You can create a page in notepad. It doesn't have to be a part of your solution. And then just upload it to the site root (next to web.config).
It doesn't matter if you're using WebForms of MVC.
And then you should navigate to http://localhost:37002/Backdoor.aspx
Kind regards,
Dejan
Yes ofcourse. I got it working. Or ye I got this error:
Exception Details: System.Configuration.Provider.ProviderException: The role 'Administrators' was not found.
But it do exists in my web.config :s
Yes, you have it in web.config but you don't have it in the database.
You can use the following code to display all roles (name this page roles.aspx or something like that):
<%@ Page Language="C#" AutoEventWireup="true" %>
<% foreach (var role in Roles.GetAllRoles()) { %>
<p><%: role %></p>
<% } %>
I believe since you are using WindowsMembershipProvider it will be difficult to create users from your code (they are not in the db), you'd need the SQL provider instead (or the Multiplexing one should you still want windows as well).
Is it your local windows administrator account (the one that you use to log on to the server) that you're trying to use? It should automatically be a member of Administrators.
Did you try allowing access to edit/admin mode for all users as above?
If you don't see "Administrators" role in the listing, you can modify the Backdoor.aspx by adding:
Roles.CreateRole("Administrators");
before
Roles.AddUserToRole("someusername", "Administrators");
Hey Mathias and thank you for your answer.. I thought I answered you but didnt get through.. I tried to change the deny users = "*" to allow instead but nothing happens. and I'm using the Multiplexing on both sides:
<location path="EPiServer/CMS/admin">
<system.web>
<authorization>
<allow roles="WebAdmins, Administrators, Everyone" />
<allow users="*" />
</authorization>
and
<authorization>
<allow roles="WebEditors, WebAdmins, Administrators, Everyone" />
<allow users="*" />
</authorization>
Alright Dejan I'm gonna see what I find!
Thanks for your answers.
So funny thing is that I find the Administrators when doing the foreach.. Ideas? ._.
Problem solved: I didn't had to change anything actually.. The problem was that I locked out all of my access from the CMS so I couldnt log in ( Yet I was authenticated) So at the log in page I changed the URL to (localhost:80/episerver < - - this gave me a redirect to the cms but told me to " reload the page" error" etc etc. Finally I got in to the "set acess rights" section and changed the premissions.
Cheers :)
Hello!
So I was testing some access rights on my machine untill I started to check the checkboxes for apply subitems? and apply parent something.
Anywyas: This made my account not available to log in again, meaning I cant log in to the CMS. Does anyone have any idea what I can do?
I'm thinking that I need to change some access somewhere but I dont know how!
Im not getting any errors Its just pushes me back to the log in page each time I try to log in.
Using WindowsMembershipProvider in Web.Config as defaultProvider and as roleManager: WindowsRoleProvider as defaultProvider.
Cheers!