Search in sources :

Example 1 with ANONYMOUSBindRequest

use of com.unboundid.ldap.sdk.ANONYMOUSBindRequest in project ldapsdk by pingidentity.

the class SASLUtilsTestCase method testANONYMOUSWithoutTrace.

/**
 * Tests the ability to create an ANONYMOUS bind without the trace option.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testANONYMOUSWithoutTrace() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, null, "mech=ANONYMOUS");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof ANONYMOUSBindRequest);
    final ANONYMOUSBindRequest anonymousBind = (ANONYMOUSBindRequest) bindRequest;
    assertNull(anonymousBind.getTraceString());
}
Also used : ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) GSSAPIBindRequest(com.unboundid.ldap.sdk.GSSAPIBindRequest) UnboundIDCertificatePlusPasswordBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest) BindRequest(com.unboundid.ldap.sdk.BindRequest) SCRAMSHA512BindRequest(com.unboundid.ldap.sdk.SCRAMSHA512BindRequest) SingleUseTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest) PLAINBindRequest(com.unboundid.ldap.sdk.PLAINBindRequest) UnboundIDYubiKeyOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest) EXTERNALBindRequest(com.unboundid.ldap.sdk.EXTERNALBindRequest) DIGESTMD5BindRequest(com.unboundid.ldap.sdk.DIGESTMD5BindRequest) UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) OAUTHBEARERBindRequest(com.unboundid.ldap.sdk.OAUTHBEARERBindRequest) UnboundIDTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest) SCRAMSHA1BindRequest(com.unboundid.ldap.sdk.SCRAMSHA1BindRequest) SCRAMSHA256BindRequest(com.unboundid.ldap.sdk.SCRAMSHA256BindRequest) CRAMMD5BindRequest(com.unboundid.ldap.sdk.CRAMMD5BindRequest) Test(org.testng.annotations.Test)

Example 2 with ANONYMOUSBindRequest

use of com.unboundid.ldap.sdk.ANONYMOUSBindRequest in project ldapsdk by pingidentity.

the class SASLUtilsTestCase method testANONYMOUSWithTrace.

/**
 * Tests the ability to create an ANONYMOUS bind with the trace option.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testANONYMOUSWithTrace() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (byte[]) null, null, "mech=ANONYMOUS", "trace=This is a test");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof ANONYMOUSBindRequest);
    final ANONYMOUSBindRequest anonymousBind = (ANONYMOUSBindRequest) bindRequest;
    assertNotNull(anonymousBind.getTraceString());
    assertEquals(anonymousBind.getTraceString(), "This is a test");
}
Also used : ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) GSSAPIBindRequest(com.unboundid.ldap.sdk.GSSAPIBindRequest) UnboundIDCertificatePlusPasswordBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest) BindRequest(com.unboundid.ldap.sdk.BindRequest) SCRAMSHA512BindRequest(com.unboundid.ldap.sdk.SCRAMSHA512BindRequest) SingleUseTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest) PLAINBindRequest(com.unboundid.ldap.sdk.PLAINBindRequest) UnboundIDYubiKeyOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest) EXTERNALBindRequest(com.unboundid.ldap.sdk.EXTERNALBindRequest) DIGESTMD5BindRequest(com.unboundid.ldap.sdk.DIGESTMD5BindRequest) UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) OAUTHBEARERBindRequest(com.unboundid.ldap.sdk.OAUTHBEARERBindRequest) UnboundIDTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest) SCRAMSHA1BindRequest(com.unboundid.ldap.sdk.SCRAMSHA1BindRequest) SCRAMSHA256BindRequest(com.unboundid.ldap.sdk.SCRAMSHA256BindRequest) CRAMMD5BindRequest(com.unboundid.ldap.sdk.CRAMMD5BindRequest) Test(org.testng.annotations.Test)

Example 3 with ANONYMOUSBindRequest

use of com.unboundid.ldap.sdk.ANONYMOUSBindRequest in project ldapsdk by pingidentity.

the class SASLUtilsTestCase method testMechNotAsOption.

/**
 * Tests the case in which the mechanism is specified as an argument rather
 * than a SASL option.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testMechNotAsOption() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, "ANONYMOUS", (List<String>) null);
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof ANONYMOUSBindRequest);
    final ANONYMOUSBindRequest anonymousBind = (ANONYMOUSBindRequest) bindRequest;
    assertNull(anonymousBind.getTraceString());
}
Also used : ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) GSSAPIBindRequest(com.unboundid.ldap.sdk.GSSAPIBindRequest) UnboundIDCertificatePlusPasswordBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest) BindRequest(com.unboundid.ldap.sdk.BindRequest) SCRAMSHA512BindRequest(com.unboundid.ldap.sdk.SCRAMSHA512BindRequest) SingleUseTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest) PLAINBindRequest(com.unboundid.ldap.sdk.PLAINBindRequest) UnboundIDYubiKeyOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest) EXTERNALBindRequest(com.unboundid.ldap.sdk.EXTERNALBindRequest) DIGESTMD5BindRequest(com.unboundid.ldap.sdk.DIGESTMD5BindRequest) UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) OAUTHBEARERBindRequest(com.unboundid.ldap.sdk.OAUTHBEARERBindRequest) UnboundIDTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest) SCRAMSHA1BindRequest(com.unboundid.ldap.sdk.SCRAMSHA1BindRequest) SCRAMSHA256BindRequest(com.unboundid.ldap.sdk.SCRAMSHA256BindRequest) CRAMMD5BindRequest(com.unboundid.ldap.sdk.CRAMMD5BindRequest) Test(org.testng.annotations.Test)

Example 4 with ANONYMOUSBindRequest

use of com.unboundid.ldap.sdk.ANONYMOUSBindRequest in project ldapsdk by pingidentity.

the class SASLUtilsTestCase method testMechOnlyAsOption.

/**
 * Tests the case in which the mechanism is specified only as a SASL option.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testMechOnlyAsOption() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, null, "mech=ANONYMOUS");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof ANONYMOUSBindRequest);
    final ANONYMOUSBindRequest anonymousBind = (ANONYMOUSBindRequest) bindRequest;
    assertNull(anonymousBind.getTraceString());
}
Also used : ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) GSSAPIBindRequest(com.unboundid.ldap.sdk.GSSAPIBindRequest) UnboundIDCertificatePlusPasswordBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest) BindRequest(com.unboundid.ldap.sdk.BindRequest) SCRAMSHA512BindRequest(com.unboundid.ldap.sdk.SCRAMSHA512BindRequest) SingleUseTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest) PLAINBindRequest(com.unboundid.ldap.sdk.PLAINBindRequest) UnboundIDYubiKeyOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest) EXTERNALBindRequest(com.unboundid.ldap.sdk.EXTERNALBindRequest) DIGESTMD5BindRequest(com.unboundid.ldap.sdk.DIGESTMD5BindRequest) UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) OAUTHBEARERBindRequest(com.unboundid.ldap.sdk.OAUTHBEARERBindRequest) UnboundIDTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest) SCRAMSHA1BindRequest(com.unboundid.ldap.sdk.SCRAMSHA1BindRequest) SCRAMSHA256BindRequest(com.unboundid.ldap.sdk.SCRAMSHA256BindRequest) CRAMMD5BindRequest(com.unboundid.ldap.sdk.CRAMMD5BindRequest) Test(org.testng.annotations.Test)

Example 5 with ANONYMOUSBindRequest

use of com.unboundid.ldap.sdk.ANONYMOUSBindRequest in project ldapsdk by pingidentity.

the class SASLUtilsTestCase method testSameMechAsArgumentAndOption.

/**
 * Tests the case in which the same mechanism is specified as both an argument
 * and an option.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testSameMechAsArgumentAndOption() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, "ANONYMOUS", "mech=ANONYMOUS");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof ANONYMOUSBindRequest);
    final ANONYMOUSBindRequest anonymousBind = (ANONYMOUSBindRequest) bindRequest;
    assertNull(anonymousBind.getTraceString());
}
Also used : ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) ANONYMOUSBindRequest(com.unboundid.ldap.sdk.ANONYMOUSBindRequest) GSSAPIBindRequest(com.unboundid.ldap.sdk.GSSAPIBindRequest) UnboundIDCertificatePlusPasswordBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest) BindRequest(com.unboundid.ldap.sdk.BindRequest) SCRAMSHA512BindRequest(com.unboundid.ldap.sdk.SCRAMSHA512BindRequest) SingleUseTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest) PLAINBindRequest(com.unboundid.ldap.sdk.PLAINBindRequest) UnboundIDYubiKeyOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest) EXTERNALBindRequest(com.unboundid.ldap.sdk.EXTERNALBindRequest) DIGESTMD5BindRequest(com.unboundid.ldap.sdk.DIGESTMD5BindRequest) UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) OAUTHBEARERBindRequest(com.unboundid.ldap.sdk.OAUTHBEARERBindRequest) UnboundIDTOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest) SCRAMSHA1BindRequest(com.unboundid.ldap.sdk.SCRAMSHA1BindRequest) SCRAMSHA256BindRequest(com.unboundid.ldap.sdk.SCRAMSHA256BindRequest) CRAMMD5BindRequest(com.unboundid.ldap.sdk.CRAMMD5BindRequest) Test(org.testng.annotations.Test)

Aggregations

ANONYMOUSBindRequest (com.unboundid.ldap.sdk.ANONYMOUSBindRequest)5 BindRequest (com.unboundid.ldap.sdk.BindRequest)5 CRAMMD5BindRequest (com.unboundid.ldap.sdk.CRAMMD5BindRequest)5 DIGESTMD5BindRequest (com.unboundid.ldap.sdk.DIGESTMD5BindRequest)5 EXTERNALBindRequest (com.unboundid.ldap.sdk.EXTERNALBindRequest)5 GSSAPIBindRequest (com.unboundid.ldap.sdk.GSSAPIBindRequest)5 OAUTHBEARERBindRequest (com.unboundid.ldap.sdk.OAUTHBEARERBindRequest)5 PLAINBindRequest (com.unboundid.ldap.sdk.PLAINBindRequest)5 SCRAMSHA1BindRequest (com.unboundid.ldap.sdk.SCRAMSHA1BindRequest)5 SCRAMSHA256BindRequest (com.unboundid.ldap.sdk.SCRAMSHA256BindRequest)5 SCRAMSHA512BindRequest (com.unboundid.ldap.sdk.SCRAMSHA512BindRequest)5 SingleUseTOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest)5 UnboundIDCertificatePlusPasswordBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest)5 UnboundIDDeliveredOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest)5 UnboundIDTOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest)5 UnboundIDYubiKeyOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest)5 Test (org.testng.annotations.Test)5