Try our conversational search powered by Generative AI!

Episerver Login

Vote:
 

I have made my custom log in which checks through the api. I have added this using OWIN middleware. 

The issue I am having is that when I try to access the admin pages through loggin in my custom login it doesn't work.

My logged in user has WebAdmins role and I can check that like this

var test = User.IsInRole("WebAdmins");

This returns true but when I try and go to /Episerver it throws me back to login page for episerver. 

Any thoughts?

#186551
Dec 22, 2017 10:24
Vote:
 

And the user is also authenticated?

It will probably be easier to help, if you share, how you have setup your Startup.cs file.

Are you using cookie authentication?

#186574
Dec 22, 2017 14:09
Vote:
 

Hi Chaudhry.

It sounds like your Authorization configuration for the Shell prevents users with WebAdmin rights to access it. That is of course assuming you are using Cookie Authentication, hence the login session is carried over to next request, and that the /Episerver URL is accessed on the same hostname (cookie being available).

  1. Try and verify your <authorization/> section contained within <location path="Episerver">. You should be able to find that inside your Web.config file. It will mostlikely authorize"WebEditors" only, hence that role is considered the least privilidged to access the Episerver back-end interface.

    <authorization>
       <allow roles="WebEditors"/>
       <deny users="*"/>
    </authorization>

    Above example configuration requires that any WebAdmins also is a member of WebEditors.

  2. Try and either update the configuration to also allow "WebAdmins" or ensure your account has "WebEditor" privileges. 

Hope that helped.

/Casper Aagaard Rasmussen

#186577
Dec 22, 2017 15:36
* 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.