Search in sources :

Example 1 with UnboundIDDeliveredOTPBindRequest

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

the class SASLUtilsTestCase method testValidDeliveredOTPBindWithAuthzID.

/**
 * Tests the ability to create a valid UNBOUNDID-DELIVERED-OTP bind request
 * with an alternate authorization ID.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testValidDeliveredOTPBindWithAuthzID() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, null, "mech=UNBOUNDID-DELIVERED-OTP", "authID=u:test.user", "authzID=u:other.user", "otp=654321");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof UnboundIDDeliveredOTPBindRequest);
    final UnboundIDDeliveredOTPBindRequest otpBind = (UnboundIDDeliveredOTPBindRequest) bindRequest;
    assertNotNull(otpBind.getAuthenticationID());
    assertEquals(otpBind.getAuthenticationID(), "u:test.user");
    assertNotNull(otpBind.getAuthorizationID());
    assertEquals(otpBind.getAuthorizationID(), "u:other.user");
    assertNotNull(otpBind.getOneTimePassword());
    assertEquals(otpBind.getOneTimePassword(), "654321");
}
Also used : UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) 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 UnboundIDDeliveredOTPBindRequest

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

the class SASLUtilsTestCase method testValidDeliveredOTPBindWithoutAuthzID.

/**
 * Tests the ability to create a valid UNBOUNDID-DELIVERED-OTP bind request
 * without an alternate authorization ID.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testValidDeliveredOTPBindWithoutAuthzID() throws Exception {
    final BindRequest bindRequest = SASLUtils.createBindRequest(null, (String) null, null, "mech=UNBOUNDID-DELIVERED-OTP", "authID=u:test.user", "otp=123456");
    assertNotNull(bindRequest);
    assertTrue(bindRequest instanceof UnboundIDDeliveredOTPBindRequest);
    final UnboundIDDeliveredOTPBindRequest otpBind = (UnboundIDDeliveredOTPBindRequest) bindRequest;
    assertNotNull(otpBind.getAuthenticationID());
    assertEquals(otpBind.getAuthenticationID(), "u:test.user");
    assertNull(otpBind.getAuthorizationID());
    assertNotNull(otpBind.getOneTimePassword());
    assertEquals(otpBind.getOneTimePassword(), "123456");
}
Also used : UnboundIDDeliveredOTPBindRequest(com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest) 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)2 BindRequest (com.unboundid.ldap.sdk.BindRequest)2 CRAMMD5BindRequest (com.unboundid.ldap.sdk.CRAMMD5BindRequest)2 DIGESTMD5BindRequest (com.unboundid.ldap.sdk.DIGESTMD5BindRequest)2 EXTERNALBindRequest (com.unboundid.ldap.sdk.EXTERNALBindRequest)2 GSSAPIBindRequest (com.unboundid.ldap.sdk.GSSAPIBindRequest)2 OAUTHBEARERBindRequest (com.unboundid.ldap.sdk.OAUTHBEARERBindRequest)2 PLAINBindRequest (com.unboundid.ldap.sdk.PLAINBindRequest)2 SCRAMSHA1BindRequest (com.unboundid.ldap.sdk.SCRAMSHA1BindRequest)2 SCRAMSHA256BindRequest (com.unboundid.ldap.sdk.SCRAMSHA256BindRequest)2 SCRAMSHA512BindRequest (com.unboundid.ldap.sdk.SCRAMSHA512BindRequest)2 SingleUseTOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.SingleUseTOTPBindRequest)2 UnboundIDCertificatePlusPasswordBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDCertificatePlusPasswordBindRequest)2 UnboundIDDeliveredOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDDeliveredOTPBindRequest)2 UnboundIDTOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDTOTPBindRequest)2 UnboundIDYubiKeyOTPBindRequest (com.unboundid.ldap.sdk.unboundidds.UnboundIDYubiKeyOTPBindRequest)2 Test (org.testng.annotations.Test)2