Try our conversational search powered by Generative AI!

Login failed error

Vote:
 

Hi,

I created latest version episerver site using episerver visual studio extension.when I am login it shows login failed error

I checked with database,but doesnot contain tables users and usersroles 

Episerver version 9.7.3

#147347
Apr 12, 2016 16:58
Vote:
 

I might got the same problem, i guess you're trying to login with your ad-creds(windows user), right?

If thats the case is can get pretty messy but this works...

You have to go to web.config and change deny="*" to allow="*" on the following things:

<location path="EPiServer">
        <allow roles="WebEditors, WebAdmins, Administrators" />
        <allow users="*" />
</location>

<location path="EPiServer/CMS/admin">
        <allow roles="WebAdmins, Administrators" />
        <allow users="*" />
</location>



Create a new file, ex temp.aspx in your website root folder and use this code.

<%@ Page Language="C#" AutoEventWireup="true" %>
<%
    var adminRole = "WebAdmins";
    var username = "Administrator";
    var password = "Administrator";
    var email = "admin@localhost.com";
  
  
if (!Roles.RoleExists(adminRole))
{
    Roles.CreateRole(adminRole);
}
  
if (Membership.GetUser(username) == null)
{
    var user = Membership.CreateUser(username, password, email);
    user.IsApproved = true;
}
  
Roles.AddUserToRole(username, adminRole); %>
  
<p>Done!</p>

Then visit http://localhost:xxxx/temp.aspx/
And make sure it says "Done!"

It will add an SQL user to your epi-database and you'll be able to login, however you might need to set access rights once you're logged in.

I bet theres a better way but i cant find any and i've spent atleast 10hrs on Google...



#147379
Edited, Apr 13, 2016 11:27
Vote:
 

Normally you can use multiplexing provider in web.config with sql provider as first provider and windows provider as your second and then log in with your windows account (which is local admin) and then create users (which will be stored using the SQL provider). If you are not properly connected to your AD though you might get in trouble sometimes when trying to log in with windows account and then the above solution from Robin works great to first create an account. Avoid creating a user with the same user name as your windows account. If you botch it and give that account too little access rights you will be in trouble :)

#147383
Edited, Apr 13, 2016 13:07
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.