Package com.google.enterprise.connector.spi

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


    this.sharepointClientContext.setUserDataStoreDAO(userDataStoreDAO);
    sharepointClientContext.setLdapConnectionSettings(TestConfiguration.getLdapConnetionSettings());
    this.authMan = new SharepointAuthenticationManager(clientFactory,
        this.sharepointClientContext, null);
    System.out.println("Initializing SharepointAuthenticationIdentity ...");
    this.authID = new SimpleAuthenticationIdentity(
        TestConfiguration.searchUserID, TestConfiguration.searchUserPwd);
  }
View Full Code Here


   * TestConfig.properties.
   *
   * @throws Throwable
   */
  public void testAuthenticateWithNullGroups() throws Throwable {
    this.authID = new SimpleAuthenticationIdentity("testuser",
        TestConfiguration.searchUserPwd);
    this.authenticationResponse = this.authMan.authenticate(this.authID);
    Collection<?> groups = this.authenticationResponse.getGroups();
    assertNull(groups);
  }
View Full Code Here

    assertNotNull(groups);
  }

  public void testAuthenticateWithDifferentUserNameFormats() throws Throwable {
    System.out.println("Testing Authenticate() with domain\\user");
    this.authID = new SimpleAuthenticationIdentity(
        TestConfiguration.userNameFormat1, TestConfiguration.searchUserPwd);
    this.authenticationResponse = this.authMan.authenticate(this.authID);
    assertTrue(this.authenticationResponse.isValid());
    // assertNotNull(this.authenticationResponse.getGroups());
    System.out.println("Authentication sucessful for : "
        + TestConfiguration.userNameFormat1);
    System.out.println("Testing Authenticate() with user@domain");
    this.authID = new SimpleAuthenticationIdentity(
        TestConfiguration.userNameFormat2, TestConfiguration.searchUserPwd);
    this.authenticationResponse = this.authMan.authenticate(this.authID);
    assertTrue(this.authenticationResponse.isValid());
    // assertNotNull(this.authenticationResponse.getGroups());
    System.out.println("Authentication sucessful for : "
        + TestConfiguration.userNameFormat2);
    System.out.println("Testing Authenticate() with user");
    this.authID = new SimpleAuthenticationIdentity(
        TestConfiguration.userNameFormat3, TestConfiguration.searchUserPwd);
    this.authenticationResponse = this.authMan.authenticate(this.authID);
    assertTrue(this.authenticationResponse.isValid());
    // assertNotNull(this.authenticationResponse.getGroups());
    System.out.println("Authentication sucessful for : "
View Full Code Here

    FileSession fs = (FileSession) connec.login();
    FileAuthenticationManager fatm = (FileAuthenticationManager) fs.getAuthenticationManager();

    //    Check FileAuthenticationManager
    SimpleAuthenticationIdentity fai = new SimpleAuthenticationIdentity(
        TestConnection.username, TestConnection.password);
    AuthenticationResponse ar = fatm.authenticate(fai);
    assertEquals(true, ar.isValid());
    assertTrue(ar.getGroups().size() > 0);

    //    Check FileAuthenticationManager for a wrong user
    SimpleAuthenticationIdentity faiWrong = new SimpleAuthenticationIdentity(TestConnection.username, TestConnection.wrongPassword);
    AuthenticationResponse arWrong = fatm.authenticate(faiWrong);
    assertEquals(false, arWrong.isValid());
  }
View Full Code Here

/** Tests the {@code LivelinkAuthenticationManager}. */
public class LivelinkAuthenticationManagerTest extends TestCase {
  public void testNullClientFactory() throws RepositoryException {
    try {
      AuthenticationManager lam = new LivelinkAuthenticationManager();
      lam.authenticate(new SimpleAuthenticationIdentity("fred"));
      fail();
    } catch (RepositoryException e) {
      if (e.getMessage().indexOf("client factory") == -1) {
        throw e;
      }
View Full Code Here

   * @throws RepositoryException if an unexpected error occurs
   */
  public void testShowHiddenItems_true() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100", "2101"), responses);
  }
View Full Code Here

  public void testShowHiddenItems_false() throws RepositoryException {
    conn.setShowHiddenItems("false");
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100"), responses);
  }
View Full Code Here

  public void testHiddenItemSubtypes() throws RepositoryException {
    // Treated as false, does not ignore documents.
    conn.setShowHiddenItems("{ 144 }");
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100"), responses);
  }
View Full Code Here

  /** Tests a small authZ request with partially authorized results. */
  public void testAuthorizeDocids_small() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101", "2102", "2103"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100", "2101"), responses);
  }
View Full Code Here

   * (1000 docids per query), with partially authorized results.
   */
  public void testAuthorizeDocids_large() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<String>();
    for (int i = 2100; i < 3300; i++) {
      builder.add(String.valueOf(i));
    }
    Collection<AuthorizationResponse> responses =
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.