Print Page | Close Window

A Login Manager is required but was not found

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4049
Printed Date: 29-Apr-2025 at 12:30pm


Topic: A Login Manager is required but was not found
Posted By: cefernan
Subject: A Login Manager is required but was not found
Date Posted: 14-Mar-2013 at 1:44pm
My silverlight application is running with no problems in my machine. When I published to run in a server, this message appear when I try to login:
"A Login Manager is required but was not found"

This was working before but I didn't realize when started this problem.

Any idea?



Replies:
Posted By: sbelini
Date Posted: 14-Mar-2013 at 3:34pm
Hi cefernan,

We need additional information:

- How are you deploying your app? Are you copying the files manually or ensuring all files are properly updated?

- Can you provide your login manager?

- How have you set site authentication on IIS?



Posted By: cefernan
Date Posted: 14-Mar-2013 at 4:42pm
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.



Posted By: kimj
Date Posted: 15-Mar-2013 at 8:24am
Also check that the assembly holding your LoginManager was deployed, and is being probed by DevForce.  The debug log generated by the EntityServer can tell you what assemblies were found.


Posted By: cefernan
Date Posted: 15-Mar-2013 at 10:16am
Kim,

I analysed the debug log and found out the problem. Some dependencies of DomainModel project were not published. I copied manually those files and now it is working fine.

Thank you so much.


Posted By: cefernan
Date Posted: 15-Mar-2013 at 11:05am
Now, I need to discover why those assemblies are not being deployed :)



Print Page | Close Window