Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.SimpleAuthenticationIdentity


    assertFalse(response.isValid());
  }

  public void testAuthenticateKnownUserNoPassword() throws Exception {
    AuthenticationResponse response = authenticationManager
        .authenticate(new SimpleAuthenticationIdentity("anakin"));
    assertTrue("known user not valid", response.isValid());
    verifyGroups(connectorSession, response);
  }
View Full Code Here


    verifyGroups(connectorSession, response);
  }

  public void testAuthenticateKnownUserBadPassword() throws Exception {
    AuthenticationResponse response = authenticationManager
        .authenticate(new SimpleAuthenticationIdentity("anakin", "foo"));
    assertFalse("valid with bad password", response.isValid());
    verifyGroups(connectorSession, response);
  }
View Full Code Here

    verifyGroups(connectorSession, response);
  }

  public void testAuthenticateKnownUser() throws Exception {
    AuthenticationResponse response = authenticationManager.authenticate(
        new SimpleAuthenticationIdentity("anakin", "password"));
    assertTrue("known user not valid", response.isValid());
    verifyGroups(connectorSession, response);
  }
View Full Code Here

    DctmAuthenticationManager authentManager = (DctmAuthenticationManager) sess
        .getAuthenticationManager();

    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK1,
            DmInitialize.DM_PWD_OK1)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_KO)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_OK2)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_KO)).isValid());
    assertFalse(authentManager
        .authenticate(
            new SimpleAuthenticationIdentity(
                DmInitialize.DM_LOGIN_OK2, null)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK3,
            DmInitialize.DM_PWD_OK3)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK1,
            DmInitialize.DM_PWD_OK1)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK5,
            DmInitialize.DM_PWD_OK5)).isValid());
  }
View Full Code Here

      AuthorizationManager authorizationManager,
      Map<String, Boolean> expectedResults, String username)
      throws RepositoryException {
    Collection<AuthorizationResponse> list =
        authorizationManager.authorizeDocids(expectedResults.keySet(),
            new SimpleAuthenticationIdentity(username, null));
    assertNotNull(list);
    for (AuthorizationResponse pm : list) {
      String uuid = pm.getDocid();
      boolean ok = pm.isValid();
      Boolean expected = expectedResults.get(uuid);
View Full Code Here

    aclList.processAcl(aclObj, aclValues);
    DctmAuthenticationManager authentManager =
        (DctmAuthenticationManager) dctmSession.getAuthenticationManager();
    AuthenticationResponse result =
        authentManager.authenticate(new SimpleAuthenticationIdentity(
            DmInitialize.DM_LOGIN_OK1, null));
    assertTrue(result.isValid());

    Principal expectedPrincipal = new Principal(PrincipalType.UNKNOWN,
        connector.getGoogleLocalNamespace(), "dm_world",
View Full Code Here

    }
  }

  public void testAuthenticate() throws RepositoryException {
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK1,
            DmInitialize.DM_PWD_OK1)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_KO)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_OK2)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2,
            DmInitialize.DM_PWD_KO)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_KO,
            DmInitialize.DM_PWD_KO)).isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(null, DmInitialize.DM_PWD_OK1))
        .isValid());
    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(null, null)).isValid());

    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK3,
            DmInitialize.DM_PWD_OK3)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK1,
            DmInitialize.DM_PWD_OK1)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK5,
            DmInitialize.DM_PWD_OK5)).isValid());

    assertFalse(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2_DOMAIN,
            DmInitialize.DM_PWD_KO)).isValid());
    assertTrue(authentManager.authenticate(
        new SimpleAuthenticationIdentity(DmInitialize.DM_LOGIN_OK2_DNS_DOMAIN,
            DmInitialize.DM_PWD_OK2_DNS_DOMAIN)).isValid());
  }
View Full Code Here

  public void testGroupLookup_only() throws Exception {
    groupSetUp();

    AuthenticationResponse result =
        authentManager.authenticate(new SimpleAuthenticationIdentity(
            DmInitialize.DM_LOGIN_OK1, null));
    assertTrue(result.isValid());
    Collection<?> groups = result.getGroups();
    assertEquals(ImmutableList.of("grp1", "grp2", "grp3", "dm_world"),
        toStrings(groups));
View Full Code Here

  public void testGroupLookup_badUser() throws Exception {
    groupSetUp();

    AuthenticationResponse result =
        authentManager.authenticate(new SimpleAuthenticationIdentity(
            DmInitialize.DM_LOGIN_KO, null));
    assertFalse(result.isValid());
  }
View Full Code Here

  public void testGroupLookup_authentication() throws Exception {
    groupSetUp();

    AuthenticationResponse result =
        authentManager.authenticate(new SimpleAuthenticationIdentity(
            DmInitialize.DM_LOGIN_OK1, DmInitialize.DM_PWD_OK1));
    assertTrue(result.isValid());
    Collection<?> groups = result.getGroups();
    assertEquals(ImmutableList.of("grp1", "grp2", "grp3", "dm_world"),
        toStrings(groups));
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.SimpleAuthenticationIdentity

Copyright © 2018 www.massapicom. 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.