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");
}
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");
}
Aggregations