Epi sever Custom Loginn

Vote:
 

Hi All

Can some one please help me, i am  stuck. When i am trying to create a custom login page.  Can some one help me on this.

Below is my sample URL , i follow the same steps mentioned inn this URL

https://world.episerver.com/blogs/Daniel-Ovaska/Dates/2016/6/creating-a-custom-login-page/

#186585
Dec 23, 2017 18:01
Vote:
 

That post is valid if you are using the old membership provider model CMS 9 or earlier. For Episerver CMS 10+ you should use the new identity model instead. I'll try to make a new blog post about that later. 

Here is a nice link to get you started in the right direction with identity

https://docs.microsoft.com/en-us/aspnet/identity/overview/getting-started/introduction-to-aspnet-identity

#186586
Dec 24, 2017 12:07
Vote:
 

Hi Daniel

I  am able to loginn Now. But the problem is i have done this by using Alloy site. Can i implement the same custom login page in Empty Site ?

In Alloy Site i have implemented, but now i am stuck at some point that is After Sucessfull Login i want to redirect to my own Page, Instead of Start Page. So i have  updated the start Page in Manage Web sites in Admin mode. Now i am not able to browse the LOGIN PAGE. IT GIVES ME ERROR.

#186599
Dec 26, 2017 13:00
Vote:
 

If you want to do redirect after login, do that in code in controller. If you change start page in admin mode you will likely break the site yes.

It's definitely possible to do the same on an empty site but I would suggest doing it the other way instead. Start with alloy site and remove what you don't need.

#186602
Dec 26, 2017 16:40
Vote:
 

Hi Daniel

Can you please provide me your email id. So that i can send  you my sample code. So that we can discuss

Thanks

#186608
Dec 27, 2017 5:43
Vote:
 

Hi Daniel,

I stumbled on this post and hope you can help me. I'm trying to do two things 1 - implement a custom login page and 2- have access to every page require authentication. I've successfully implemented OWIN and a regular MVC application but am struggling with Epi.

I've used the code from this article which included a downloadable zip file.

https://support.episerver.com/hc/en-us/articles/115002559451

Here's the code in startup.cs

public void Configuration(IAppBuilder app)
{

app.AddCmsAspNetIdentity<ApplicationUser>();

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Login"),
Provider = new CookieAuthenticationProvider
{

OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager<ApplicationUser>, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => manager.GenerateUserIdentityAsync(user))
}
});

}

When I debug, I can see that startup.cs fires. 

I have two problems 

1) Startup page is shown without requiring authentication

2) Admin pages still use the standard epi login page.

Any ideas of what I'm doing wrong?

Thanks.

#187903
Feb 06, 2018 4:37
Vote:
 
  1. In admin you need to remove access rights for everyone in the page tree. Check the administrators handbook if you need exact details.
  2. That url is set in web.config somewhere. If you search for login you will find the line of config to change.
#187918
Feb 06, 2018 13:49
* 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.