Class GetAuthorizationEntryRequestControl
java.lang.Object
com.unboundid.ldap.sdk.Control
com.unboundid.ldap.sdk.unboundidds.controls.GetAuthorizationEntryRequestControl
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class GetAuthorizationEntryRequestControl
extends Control
This class provides an implementation of an LDAP control that can be included
in a bind request to request that the Directory Server return the
authentication and authorization entries for the user that authenticated.
The value of this control may be absent, but if it is present then will be encoded as follows:
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
The value of this control may be absent, but if it is present then will be encoded as follows:
GetAuthorizationEntryRequest ::= SEQUENCE {
includeAuthNEntry [0] BOOLEAN DEFAULT TRUE,
includeAuthZEntry [1] BOOLEAN DEFAULT TRUE,
attributes [2] AttributeSelection OPTIONAL }
Example
The following example demonstrates the process for processing a bind operation using the get authorization entry request control to return all user attributes in both the authentication and authorization entries:
ReadOnlyEntry authNEntry = null;
ReadOnlyEntry authZEntry = null;
BindRequest bindRequest = new SimpleBindRequest(
"uid=john.doe,ou=People,dc=example,dc=com", "password",
new GetAuthorizationEntryRequestControl());
BindResult bindResult = connection.bind(bindRequest);
GetAuthorizationEntryResponseControl c =
GetAuthorizationEntryResponseControl.get(bindResult);
if (c != null)
{
authNEntry = c.getAuthNEntry();
authZEntry = c.getAuthZEntry();
}
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe OID (1.3.6.1.4.1.30221.2.5.6) for the get authorization entry request control. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new get authorization entry request control that will request all user attributes in both the authentication and authorization entries.GetAuthorizationEntryRequestControl(boolean isCritical, boolean includeAuthNEntry, boolean includeAuthZEntry, String... attributes) Creates a new get authorization entry request control with the provided information.GetAuthorizationEntryRequestControl(boolean isCritical, boolean includeAuthNEntry, boolean includeAuthZEntry, List<String> attributes) Creates a new get authorization entry request control with the provided information.GetAuthorizationEntryRequestControl(boolean includeAuthNEntry, boolean includeAuthZEntry, String... attributes) Creates a new get authorization entry request control with the provided information.GetAuthorizationEntryRequestControl(boolean includeAuthNEntry, boolean includeAuthZEntry, List<String> attributes) Creates a new get authorization entry request control with the provided information.Creates a new get authorization entry request control which is decoded from the provided generic control. -
Method Summary
Modifier and TypeMethodDescriptiondecodeJSONControl(JSONObject controlObject, boolean strict) Attempts to decode the provided object as a JSON representation of a get authorization entry request control.Retrieves the attributes that will be requested for the authentication and/or authorization entries.Retrieves the user-friendly name for this control, if available.booleanIndicates whether the entry for the authenticated user should be included in the response control.booleanIndicates whether the entry for the authorized user should be included in the response control.Retrieves a representation of this get authorization entry request control as a JSON object.voidtoString(StringBuilder buffer) Appends a string representation of this LDAP control to the provided buffer.Methods inherited from class com.unboundid.ldap.sdk.Control
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toString, writeTo
-
Field Details
-
GET_AUTHORIZATION_ENTRY_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.5.6) for the get authorization entry request control.- See Also:
-
-
Constructor Details
-
GetAuthorizationEntryRequestControl
public GetAuthorizationEntryRequestControl()Creates a new get authorization entry request control that will request all user attributes in both the authentication and authorization entries. It will not be marked critical. -
GetAuthorizationEntryRequestControl
public GetAuthorizationEntryRequestControl(boolean includeAuthNEntry, boolean includeAuthZEntry, @Nullable String... attributes) Creates a new get authorization entry request control with the provided information.- Parameters:
includeAuthNEntry- Indicates whether to include the authentication entry in the response.includeAuthZEntry- Indicates whether to include the authorization entry in the response.attributes- The attributes to include in the entries in the response. It may be empty ornullto request all user attributes.
-
GetAuthorizationEntryRequestControl
public GetAuthorizationEntryRequestControl(boolean includeAuthNEntry, boolean includeAuthZEntry, @Nullable List<String> attributes) Creates a new get authorization entry request control with the provided information.- Parameters:
includeAuthNEntry- Indicates whether to include the authentication entry in the response.includeAuthZEntry- Indicates whether to include the authorization entry in the response.attributes- The attributes to include in the entries in the response. It may be empty ornullto request all user attributes.
-
GetAuthorizationEntryRequestControl
public GetAuthorizationEntryRequestControl(boolean isCritical, boolean includeAuthNEntry, boolean includeAuthZEntry, @Nullable String... attributes) Creates a new get authorization entry request control with the provided information.- Parameters:
isCritical- Indicates whether the control should be marked critical.includeAuthNEntry- Indicates whether to include the authentication entry in the response.includeAuthZEntry- Indicates whether to include the authorization entry in the response.attributes- The attributes to include in the entries in the response. It may be empty ornullto request all user attributes.
-
GetAuthorizationEntryRequestControl
public GetAuthorizationEntryRequestControl(boolean isCritical, boolean includeAuthNEntry, boolean includeAuthZEntry, @Nullable List<String> attributes) Creates a new get authorization entry request control with the provided information.- Parameters:
isCritical- Indicates whether the control should be marked critical.includeAuthNEntry- Indicates whether to include the authentication entry in the response.includeAuthZEntry- Indicates whether to include the authorization entry in the response.attributes- The attributes to include in the entries in the response. It may be empty ornullto request all user attributes.
-
GetAuthorizationEntryRequestControl
Creates a new get authorization entry request control which is decoded from the provided generic control.- Parameters:
control- The generic control to decode as a get authorization entry request control.- Throws:
LDAPException- If the provided control cannot be decoded as a get authorization entry request control.
-
-
Method Details
-
includeAuthNEntry
Indicates whether the entry for the authenticated user should be included in the response control.- Returns:
trueif the entry for the authenticated user should be included in the response control, orfalseif not.
-
includeAuthZEntry
Indicates whether the entry for the authorized user should be included in the response control.- Returns:
trueif the entry for the authorized user should be included in the response control, orfalseif not.
-
getAttributes
Retrieves the attributes that will be requested for the authentication and/or authorization entries.- Returns:
- The attributes that will be requested for the authentication and/or authorization entries, or an empty list if all user attributes should be included.
-
getControlName
Retrieves the user-friendly name for this control, if available. If no user-friendly name has been defined, then the OID will be returned.- Overrides:
getControlNamein classControl- Returns:
- The user-friendly name for this control, or the OID if no user-friendly name is available.
-
toJSONControl
Retrieves a representation of this get authorization entry request control as a JSON object. The JSON object uses the following fields:-
oid-- A mandatory string field whose value is the object identifier for this control. For the get authorization entry request control, the OID is "1.3.6.1.4.1.30221.2.5.6". -
control-name-- An optional string field whose value is a human-readable name for this control. This field is only intended for descriptive purposes, and when decoding a control, theoidfield should be used to identify the type of control. -
criticality-- A mandatory Boolean field used to indicate whether this control is considered critical. -
value-base64-- An optional string field whose value is a base64-encoded representation of the raw value for this get authorization entry request control. Exactly one of thevalue-base64andvalue-jsonfields must be present. -
value-json-- An optional JSON object field whose value is a user-friendly representation of the value for this get authorization entry request control. Exactly one of thevalue-base64andvalue-jsonfields must be present, and if thevalue-jsonfield is used, then it will use the following fields:-
include-authentication-entry-- A mandatory Boolean field that indicates whether to include the entry for the authentication identity in the response control. -
include-authorization-entry-- A mandatory Boolean field that indicates whether to include the entry for the authorization identity in the response control. -
attributes-- An optional array field whose values are strings that represent the names of the attributes that should be included in the entries returned in the repsonse control.
-
- Overrides:
toJSONControlin classControl- Returns:
- A JSON object that contains a representation of this control.
-
-
decodeJSONControl
@NotNull public static GetAuthorizationEntryRequestControl decodeJSONControl(@NotNull JSONObject controlObject, boolean strict) throws LDAPException Attempts to decode the provided object as a JSON representation of a get authorization entry request control.- Parameters:
controlObject- The JSON object to be decoded. It must not benull.strict- Indicates whether to use strict mode when decoding the provided JSON object. If this istrue, then this method will throw an exception if the provided JSON object contains any unrecognized fields. If this isfalse, then unrecognized fields will be ignored.- Returns:
- The get authorization entry request control that was decoded from the provided JSON object.
- Throws:
LDAPException- If the provided JSON object cannot be parsed as a valid get authorization entry request control.
-
toString
Appends a string representation of this LDAP control to the provided buffer.
-