Examples of authenticateUser()


Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

      throws Exception
  {
    LdapManager ldapManager = this.lookup(LdapManager.class);
    LdapServer ldapServer = this.getLdapServer("default");

    Assert.assertNotNull(ldapManager.authenticateUser("brianf", "brianf123"));

    ldapServer.stop();

    try {
      ldapManager.authenticateUser("brianf", "brianf123");
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    Assert.assertNotNull(ldapManager.authenticateUser("brianf", "brianf123"));

    ldapServer.stop();

    try {
      ldapManager.authenticateUser("brianf", "brianf123");
      Assert.fail("Expected AuthenticationException");
    }
    catch (AuthenticationException e) {
      // expected
    }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    }

    ldapServer.start();

    try {
      ldapManager.authenticateUser("brianf", "brianf123");
      Assert.fail("Expected AuthenticationException");
    }
    catch (AuthenticationException e) {
      // expected
    }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

      // expected
    }

    // wait 3 more sec, then we should be good
    Thread.sleep(7 * 1000);
    Assert.assertNotNull(ldapManager.authenticateUser("brianf", "brianf123"));
  }

  @Test
  public void testGetAllGroups()
      throws Exception
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    groupIds.add("alpha");
    groupIds.add("beta");
    groupIds.add("gamma");

    LdapManager ldapManager = this.lookup(LdapManager.class);
    LdapUser jmeis = ldapManager.authenticateUser("jmeis", "jmeis123");
    Assert.assertEquals(groupIds, jmeis.getMembership());

    LdapUser rwalker = ldapManager.authenticateUser("rwalker", "rwalker123");
    Assert.assertEquals(groupIds, rwalker.getMembership());
  }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    LdapManager ldapManager = this.lookup(LdapManager.class);
    LdapUser jmeis = ldapManager.authenticateUser("jmeis", "jmeis123");
    Assert.assertEquals(groupIds, jmeis.getMembership());

    LdapUser rwalker = ldapManager.authenticateUser("rwalker", "rwalker123");
    Assert.assertEquals(groupIds, rwalker.getMembership());
  }


  protected MockLdapConnector buildMainMockServerTwo(String serverId) {
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

  public void testAuthenticate()
      throws Exception
  {
    LdapManager ldapManager = this.lookup(LdapManager.class);

    Assert.assertNotNull(ldapManager.authenticateUser("brianf", "brianf123"));

    try {
      ldapManager.authenticateUser("brianf", "junk");
      Assert.fail("Expected AuthenticationException");
    }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    LdapManager ldapManager = this.lookup(LdapManager.class);

    Assert.assertNotNull(ldapManager.authenticateUser("brianf", "brianf123"));

    try {
      ldapManager.authenticateUser("brianf", "junk");
      Assert.fail("Expected AuthenticationException");
    }
    catch (AuthenticationException e) {
      // expected
    }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

    catch (AuthenticationException e) {
      // expected
    }

    try {
      ldapManager.authenticateUser("junk", "junk");
      Assert.fail("Expected AuthenticationException");
    }
    catch (AuthenticationException e) {
      // expected
    }
View Full Code Here

Examples of org.sonatype.security.ldap.realms.LdapManager.authenticateUser()

      throws Exception
  {
    LdapManager ldapManager = this.lookup(LdapManager.class);

    // all systems are good
    Assert.assertNotNull(ldapManager.authenticateUser("rwalker", "rwalker123"));

    // stop the main server
    mainConnector.stop();

    // try again, this time it should hit the cache
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.