tags:

views:

41

answers:

2

I am trying to get the below code to work, but with no luck;

    bool success = Sitecore.Security.Authentication.AuthenticationManager.Login(UserName.Text, Password.Text);
    if (success)
    {           
        string path = Request.QueryString["path"];   
        Sitecore.Web.WebUtil.Redirect(String.IsNullOrEmpty(path) ? "/" : path);
    }

success is always false, eventhough i know that the entered username and password is correct and created on the extranet domain.

What am i missing?

(It's a Sitecore 6.2)

+2  A: 

I'd guess that the LoginManager needs the full username including the domain. So try:

bool success = Sitecore.Security.Authentication.AuthenticationManager.Login(
   "extranet\\" + UserName.Text, Password.Text);
driis
A: 

Like Driis say, the domain is required.

And just FYI, to login a Sitecore user, the domain must be "sitecore\"

Holger