use of com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientRequestControl in project ldapsdk by pingidentity.
the class LDAPConnectionTestCase method testCloseWithControls.
/**
* Tests the {@code close} method variant that allows controls to be included.
* <BR><BR>
* Access to a Directory Server instance is required for complete processing.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testCloseWithControls() throws Exception {
if (!isDirectoryInstanceAvailable()) {
return;
}
Control[] controls = { new IntermediateClientRequestControl(null, null, null, null, "testCloseWithControls", null, null) };
LDAPConnection conn = getAdminConnection();
conn.close(controls);
}
use of com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientRequestControl in project ssam by pingidentity.
the class SSAMController method getIntermediateClientRequestControl.
/**
* Returns an intermediate client request control using the authzId of the
* currently authenticated user.
*
* @return an IntermediateClientRequestControl using the authorizationID of
* the currently authenticated user
*/
private IntermediateClientRequestControl getIntermediateClientRequestControl() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Object userDetails = authentication.getDetails();
String authzId = userDetails instanceof LDAPUser ? ((LDAPUser) userDetails).getAuthzID() : "u:" + authentication.getName();
return new IntermediateClientRequestControl(null, null, null, authzId, CLIENT_SESSION_ID, null, null);
}
Aggregations