More in this section

Forums / Developing with Sitefinity / Login - By Email instead of username?

Login - By Email instead of username?

4 posts, 0 answered
  1. Matthew
    Matthew avatar
    33 posts
    Registered:
    15 Dec 2008
    20 Jan 2009
    Link to this post
    For the project I'm currently developing, I'd like to authenticate users by 'email address' and not 'username' and of course password. It's simple enough to change in the Login control UI, but I can't seem to find the authenticate method that controls the validation of user on login.

    Is there something i'm missing? Is there a way to override this easily?

    Thanks in advance!
    Matt

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jan 2009
    Link to this post
    Hello Matthew,

    The easiest way is to change the FieldLabel control Text property and replace it with E-mail address instead of Username. The control is located in ~\Sitefinity\Login.aspx. Then, the username of your users should be the same as the email when you register them.

    Another way is to implement your own membership provider that looks at the email instead of the usernames. Also, the provider has ValidateUser method which requires string username, string password.

    e.Authenticated = UserManager.Default.ValidateUser(this.Login1.UserName, this.Login1.Password); 

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Matthew
    Matthew avatar
    33 posts
    Registered:
    15 Dec 2008
    20 Jan 2009
    Link to this post
    Thanks, those were the two conclusions I came to after poking around and thinking more about it. I just wanted to check in with the experts before I hack things up in case there was a simplier remedy.

    Thanks again, this is my first SI project (6 years developing .Net apps) and I must say it's by far the easiest CMS to work with by far. Also, your response to my inquires have been great. I'll be using SI for more projects in the future.

    Matt
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jan 2009
    Link to this post
    Hello Matthew,

    Thank you for your feedback.

    Let us know if there is anything else that we can do for you.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered