Try our conversational search powered by Generative AI!

Specific Login Pages

Vote:
 

Hello,

I'm wondering if you can all help, we have a site with member protected pages - if someone attempts to access a page they don't have rights to the user gets redirected to the Episerver Admin login. How can we change this so it goes to our members login instead.

Hope this makes sense.

Thanks

Paul

#114409
Dec 11, 2014 14:17
Vote:
 

You can change this in web.config under <system.web><authentication><forms loginUrl="..." /></authentication></system.web>.

Frederik

#114414
Dec 11, 2014 15:15
Vote:
 

Hi Frederik,

Thanks for your response, how can I change this so the admin area of the CMS retains the orginal Episerver login and the front-end members area refers to the front-end login? They both use forms authentication.

Thanks

Paul

#114443
Edited, Dec 11, 2014 16:21
Vote:
 

I would add some redirect logic in your custom login page that check this and redirects if the return url goes to edit/admin mode.

Frederik

#114444
Dec 11, 2014 16:25
Vote:
 

We have added this logic:

if(!string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]) &&  Request.QueryString["ReturnUrl"].Contains("admin")) {
                Response.Redirect("/Util/login.aspx", false);
                Context.ApplicationInstance.CompleteRequest();
            }
            else
            {
                Response.Redirect("/en/members/", false);
            }

And in the webconfig file I changed the following line:

<authentication mode="Forms">
     <forms name=".EPiServerLogin" loginUrl="/admrdr.aspx" timeout="4320" defaultUrl="~/" requireSSL="true" />
    </authentication>

It works great for members but if you try and login to the Admin page it redirects back to itelf.

#118259
Mar 03, 2015 14:32
Vote:
 

Don't forget to add the ReturnUrl-parameter to your redirect, that's why you stay on the login page.

/Erik

#118261
Mar 03, 2015 15:27
Vote:
 

Hi,

I added a RedirectUrl=admin but it takes me back to the CMS login screen (/Util/login.aspx) but then if I change the url to /admin it takes me to the CMS.

#118268
Mar 03, 2015 16:01
Vote:
 

Response.Redirect("/Util/login.aspx?ReturnUrl=" + Request["ReturnUrl"], false);

should work. If it's EPiServer Admin/edit you're talking about I would probably change the if-statement to Request.QueryString["ReturnUrl"].ToLower().Contains("episerver") instead.

#118307
Mar 04, 2015 9:46
Vote:
 

Hi,

I am trying to implement Member registration and login for the front end. These members will only have access to the front end.

Can you suggests some reference links to achieve this.

Thanks
Pankaj

 

#118616
Mar 11, 2015 7:11
Vote:
 

I know this is like 2 and a half years old but @pankaj were you able to find a solution for this?

#184552
Oct 31, 2017 9:23
* 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.