Hi Silvio,
I'm deploying publishing the project through WebDeploy in VS.
This is my LoginManager:
public class LoginManager : IEntityLoginManager
{
#region IEntityLoginManager Implementation
public IPrincipal Login(ILoginCredential credential, EntityManager entityManager)
{
entityManager.VerifierEngine.ErrorsResourceManager = i18n.Localization.ErrorMessages.ResourceManager;
if (credential == null)
throw new LoginException(LoginExceptionType.NoCredentials, "Credentials are required.");
if (string.IsNullOrWhiteSpace(credential.UserName))
throw new LoginException(LoginExceptionType.InvalidUserName, "Username cannot be empty.");
if (string.IsNullOrWhiteSpace(credential.Password))
throw new LoginException(LoginExceptionType.InvalidPassword, "Password cannot be empty.");
var em = new CrmallEntities(entityManager);
var result = em.PersonUsers.Where(u => u.Login.ToUpper() == credential.UserName.ToUpper()
&& u.Password == credential.Password)
.Include(f => f.Person)
.Include(f => f.PersonUserProfile)
.Include("PersonUserProfile.SysLanguage")
.Include("PersonUserProfile.SysTimeZoneInfo")
.Execute();
PersonUser user = result.FirstOrDefault();
if (user == null)
throw new LoginException(LoginExceptionType.InvalidPassword, credential.Domain, credential.UserName);
AppDateTime.Initialize();
AuditManager.AuditLogon(em, user);
return user;
}
public void Logout(IPrincipal principal, EntityManager entityManager)
{
AuditManager.AuditLogoff(new CrmallEntities(entityManager), principal as PersonUser);
entityManager.RejectChanges();
}
}
Authentication on IIS is enabled just anonymous.