Skip to content

Instantly share code, notes, and snippets.

@RyanABailey
Created November 9, 2015 01:16
Show Gist options
  • Select an option

  • Save RyanABailey/0bd0e81fd421bde8bf38 to your computer and use it in GitHub Desktop.

Select an option

Save RyanABailey/0bd0e81fd421bde8bf38 to your computer and use it in GitHub Desktop.
Sitecore User Login
private static string Domain = "extranet";
public static bool Login(string email, string password)
{
var username = string.Format(@"{0}\{1}", Domain, email);
try
{
if (Sitecore.Security.Authentication.AuthenticationManager.Login(username, password))
{
return true;
}
}
catch (System.Security.Authentication.AuthenticationException exception)
{
// log error
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment