use of com.unboundid.ldap.sdk.SCRAMSHA256BindRequest in project ldapsdk by pingidentity.
the class SASLUtilsTestCase method testValidSCRAMSHA256Bind.
/**
* Tests the ability to create a valid SCRAM-SHA-256 bind request.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testValidSCRAMSHA256Bind() throws Exception {
final BindRequest bindRequest = SASLUtils.createBindRequest(null, "password", null, "mech=SCRAM-SHA-256", "username=jdoe");
assertNotNull(bindRequest);
assertTrue(bindRequest instanceof SCRAMSHA256BindRequest);
final SCRAMSHA256BindRequest scramBind = (SCRAMSHA256BindRequest) bindRequest;
assertNotNull(scramBind.getUsername());
assertEquals(scramBind.getUsername(), "jdoe");
assertNotNull(scramBind.getPasswordString());
assertEquals(scramBind.getPasswordString(), "password");
}
Aggregations