Package org.nasutekds.server.core

Examples of org.nasutekds.server.core.BindOperation


  public void testOutOfSequenceBind()
         throws Exception
  {
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5,
                              ByteString.valueOf("invalid"));
    assertFalse(bindOperation.getResultCode() == ResultCode.SUCCESS);
  }
View Full Code Here


  public void testMalformedCredentials()
         throws Exception
  {
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5, null);
    assertEquals(bindOperation.getResultCode(),
                 ResultCode.SASL_BIND_IN_PROGRESS);

    bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5,
                              ByteString.valueOf("malformed"));
    assertFalse(bindOperation.getResultCode() == ResultCode.SUCCESS);
  }
View Full Code Here

  public void testMalformedDigest()
         throws Exception
  {
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5, null);
    assertEquals(bindOperation.getResultCode(),
                 ResultCode.SASL_BIND_IN_PROGRESS);

    ByteString creds =
         ByteString.valueOf("dn:cn=Directory Manager malformeddigest");
    bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5, creds);
    assertFalse(bindOperation.getResultCode() == ResultCode.SUCCESS);
  }
View Full Code Here

  public void testMalformedDigestWithCorrectLength()
         throws Exception
  {
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5, null);
    assertEquals(bindOperation.getResultCode(),
                 ResultCode.SASL_BIND_IN_PROGRESS);

    ByteString creds =
         ByteString.valueOf("dn:cn=Directory Manager " +
                          "malformedcredswiththerightlength");
    bindOperation =
         conn.processSASLBind(DN.nullDN(), SASL_MECHANISM_CRAM_MD5, creds);
    assertFalse(bindOperation.getResultCode() == ResultCode.SUCCESS);
  }
View Full Code Here

  public void testProcessSimpleBind1()
         throws Exception
  {
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperation bindOperation =
         conn.processSimpleBind(ByteString.valueOf("cn=Directory Manager"),
                                ByteString.valueOf("password"));
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

  public void testProcessSimpleBind2()
         throws Exception
  {
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperation bindOperation =
         conn.processSimpleBind(DN.decode("cn=Directory Manager"),
                                ByteString.valueOf("password"));
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

    ByteString creds =
         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperation bindOperation =
         conn.processSASLBind(ByteString.empty(), "PLAIN", creds);
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

    ByteString creds =
         ByteString.valueOf("\u0000dn:cn=Directory Manager\u0000password");

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    BindOperation bindOperation =
         conn.processSASLBind(DN.nullDN(), "PLAIN", creds);
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

                 0);

    // Perform an internal bind to verify the password was actually changed.
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSimpleBind(DN.decode("cn=Directory Manager"),
                                ByteString.valueOf("newPassword"));
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);


    // Now change the password back to what it was.
    args = new String[]
    {
View Full Code Here

                 0);

    // Perform an internal bind to verify the password was actually changed.
    InternalClientConnection conn =
         new InternalClientConnection(new AuthenticationInfo());
    BindOperation bindOperation =
         conn.processSimpleBind(DN.decode("cn=Directory Manager"),
                                ByteString.valueOf("newPassword"));
    assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS);


    // Now change the password back to what it was.
    args = new String[]
    {
View Full Code Here

TOP

Related Classes of org.nasutekds.server.core.BindOperation

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.