public final class AuthorizationIdentityResponseControl extends Object implements Control
The authorization identity is specified using an authorization ID, or
authzId, as defined in RFC 4513 section 5.2.1.8.
The following excerpt shows how to get the authorization identity established when binding to the directory server.
Connection connection = ...;
String bindDN = ...;
String bindPassword = ...;
BindRequest request =
Requests.newSimpleBindRequest(bindDN, bindPassword.toCharArray())
.addControl(AuthorizationIdentityRequestControl
.newControl(true));
BindResult result = connection.bind(request);
AuthorizationIdentityResponseControl control =
result.getControl(AuthorizationIdentityResponseControl.DECODER,
new DecodeOptions());
// Authorization ID returned: control.getAuthorizationID()
AuthorizationIdentityRequestControl,
WhoAmIExtendedRequest,
RFC 3829 - Lightweight
Directory Access Protocol (LDAP) Authorization Identity Request and
Response Controls ,
RFC 4532 - Lightweight
Directory Access Protocol (LDAP) "Who am I?" Operation ,
RFC 4513 -
SASL Authorization Identities (authzId) | Modifier and Type | Field and Description |
|---|---|
static ControlDecoder<AuthorizationIdentityResponseControl> |
DECODER
A decoder which can be used for decoding the authorization identity
response control.
|
static String |
OID
The OID for the authorization identity response control.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthorizationID()
Returns the authorization ID of the user.
|
String |
getOID()
Returns the numeric OID associated with this control.
|
ByteString |
getValue()
Returns the value, if any, associated with this control.
|
boolean |
hasValue()
Returns
true if this control has a value. |
boolean |
isCritical()
Returns
true if it is unacceptable to perform the operation
without applying the semantics of this control. |
static AuthorizationIdentityResponseControl |
newControl(String authorizationID)
Creates a new authorization identity response control using the provided
authorization ID.
|
String |
toString() |
public static final String OID
public static final ControlDecoder<AuthorizationIdentityResponseControl> DECODER
public static AuthorizationIdentityResponseControl newControl(String authorizationID)
authorizationID - The authorization ID for this control.NullPointerException - If authorizationID was null.public String getAuthorizationID()
public ByteString getValue()
public boolean hasValue()
true if this control has a value. In some circumstances
it may be useful to determine if a control has a value, without actually
calculating the value and incurring any performance costs.public boolean isCritical()
true if it is unacceptable to perform the operation
without applying the semantics of this control.
The criticality field only has meaning in controls attached to request
messages (except UnbindRequest). For controls attached to response
messages and the UnbindRequest, the criticality field SHOULD be
false, and MUST be ignored by the receiving protocol peer. A
value of true indicates that it is unacceptable to perform the
operation without applying the semantics of the control.
isCritical in interface Controltrue if this control must be processed by the Directory
Server, or false if it can be ignored.Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.