Try our conversational search powered by Generative AI!

Member login

Vote:
 

Pardon my ignorance on this subject, I am new to Episerver.

I want to create a member registration, login, Facebook login and forgot password page. This is for the users who will have access to the restricted content on the site. These users will have nothing to do with the Episerver CMS.

I tried searching on this topic but did not find any relevant information.

Can someone help me with any reference links or info in this regard.

Thanks
Pankaj

 

#118602
Mar 10, 2015 16:56
Vote:
 

You can create a separate page types for Register / Login / Reset password page, and then implement the logic in index action.

I blogged about login functionality in AlloyTech using web api 2: http://dcaric.com/blog/episerver-login-functionality-using-web-api-2

Could be helpful :)

#118622
Mar 11, 2015 9:22
Vote:
 

Thanks Dejan, I followed your blog post and was able to set up a Login page.

In the same way I can setup the registration page as well (if that’s possible).

I have few questions such as:

  • Are these users same as Episerver CMS users.
  • Once I register a user from new registration page, will they have access to Episerver CMS. I dont want that to happen.
  • While registering a user I want to include features like Birth Date, Facebook ID. Is this possible (creating new properties for front end user).

Thanks
Pankaj

 

 

#118624
Mar 11, 2015 9:42
Vote:
 

I don't see it as EPi and non-EPi users.
In web.config, you can set different role and membership providers. Just like in any other ASP.NET application.

Then in web.config, you can set which users / groups have access to admin mode.

<location path="EPiServer/CMS/admin">
    <system.web>
        <authorization>
            <allow roles="CmsAdmins" />
            <deny users="*" />
        </authorization>
    </system.web>
</location>

CmsAdmins role can be from SqlServerRoleProvider, WindowsRoleProvider, your custom provider...

Birth date, first name, last name etc. can be stored in user profile http://world.episerver.com/documentation/Class-library/?documentId=cms/7/bcecc938-7158-9fa0-1922-380c0b16c17f

Or you can store them in some custom table.

Here's a nice tutorial regarding Facebook / Twitter / LinkedIn login: http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

#118625
Mar 11, 2015 10:24
Vote:
 

Hi Dejan,

I am palning to implement Asp.Net Identity as a membership provider.

How does it impact Episerver? How can I configure Asp.Net Identity as a secondary provider, keeping default (Sql server) as is?

Thanks
Pankaj

#118679
Mar 11, 2015 15:50
Vote:
 

You can't combine OWIN authentication, such as ASP.NET Identity, and the Role+Membership Providers concept inside of EPi. When using OWIN authentication you set <authentication mode="None"></authentication>.

See http://world.episerver.com/documentation/items/developers-guide/episerver-cms/75/security/owin-authentication

#118682
Edited, Mar 11, 2015 16:25
Vote:
 

Hi Dejan,

I am trying to get Web API working but I'm just getting 404s no matter what I do.

Thanks

#118691
Mar 11, 2015 17:48
Vote:
 

Hi Pankaj,

It’s difficult to tell w/o seeing the source code.

You can get 404 if:
1. You didn’t register attribute routing. You can do it global.asax.cs inside Application_Start() method, or you can create an initializable module. Pick one, you don't need both
2. If you’re not using classes as parameters in controller actions. For example
[Route(“login”)]
[HttpPost]
public IHttpActionResult AuthenticateUser(LoginInfo loginInfo) { }
works fine, while
[Route(“login”)]
[HttpPost]
public IHttpActionResult AuthenticateUser(string username, string password) { }
may result in 404.
#118695
Mar 11, 2015 21:49
Vote:
 

Hi Dejan,

My bad, was using below.

[Route(“login”)]
[HttpPost]
public IHttpActionResult AuthenticateUser(string username, string password) { }

Hence the 404.

I am using the EPiServerProfile class to store additional properties for the users. The challenge now is how can I list these additional properties in the backend.

Thanks
Pankaj

#118700
Mar 12, 2015 8:46
Vote:
 

Thanks Johan, your comment put me in the right direction.

#118701
Mar 12, 2015 8:49
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.