public void DoAuthenticationWithDbTest() { LdapAuthenticator ldapAuth = new LdapAuthenticator(); UserVO expected = ldapAuth.CreateSession("testes.nddigital.local", "matheus.silva", "ndd@123"); Assert.AreEqual(expected.Logon, "matheus.silva"); }
public void DoAuthenticationTestWrongDomain() { LdapAuthenticator ldapAuth = new LdapAuthenticator(); bool expected = ldapAuth.DoAuthentication("nddigital", "matheus.silva", "ndd@123"); Assert.AreEqual(expected, false); }
public void DoAuthenticationTesWrongPass() { LdapAuthenticator ldapAuth = new LdapAuthenticator(); bool expected = ldapAuth.DoAuthentication("testes", "matheus.silva", "ndd"); Assert.AreEqual(expected, false); }
public void DoAuthenticationTestSimpleDomain() { LdapAuthenticator ldapAuth = new LdapAuthenticator(); bool expected = ldapAuth.DoAuthentication("testes", "matheus.silva", "ndd@123"); Assert.AreEqual(expected, true); }
public void DoAuthenticationTest() { LdapAuthenticator ldapAuth = new LdapAuthenticator(); bool expected = ldapAuth.DoAuthentication("testes.nddigital.local", "matheus.silva", "ndd@123"); Assert.AreEqual(expected, true); }
private static IAuthenticator InitAuthenticator(Settings settings) { var authenticator = InitLdap(settings, delegate(LdapCredentials creds) { #if DEBUG var auth = new DummyAuthenticator(); #else var auth = new LdapAuthenticator(creds); auth.Connect(); #endif return(auth); }); var authenticatorCache = new AuthenticatorCache(authenticator, (int)settings.SECURITY_CACHE_EXPIRATION); MasterContainer.AddService <IAuthenticator>(authenticatorCache); ProgramOutput.Info("Authenticator initialized, LDAP connection to {0} up.", authenticator.ConnectedServer); return(authenticatorCache); }