Record Class WhoAmIExtendedRequest
java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.messages.WhoAmIExtendedRequest
- Record Components:
controls- theListcontaining the controls.
- All Implemented Interfaces:
ExtendedRequest<WhoAmIExtendedResult>,ProtocolOp,Request
public record WhoAmIExtendedRequest(List<Control> controls)
extends Record
implements ExtendedRequest<WhoAmIExtendedResult>
The who am I extended request as defined in RFC 4532. This operation allows
clients to obtain the primary authorization identity, in its primary form,
that the server has associated with the user or application entity.
The following example demonstrates use of the Who Am I? request and response.
Connection connection = ...;
String name = ...;
char[] password = ...;
Result result = connection.bind(name, password);
if (result.isSuccess()) {
WhoAmIExtendedRequest request = Requests.newWhoAmIExtendedRequest();
WhoAmIExtendedResult extResult = connection.extendedRequest(request);
if (extResult.isSuccess()) {
// Authz ID: " + extResult.getAuthorizationID());
}
}
This operation may preferable to the Authorization Identity Controls
mechanism defined in RFC 3829, which uses Bind request and response controls
to request and return the authorization identity. Bind controls are not
protected by security layers established by the Bind operation that includes
them. While it is possible to establish security layers using StartTLS prior
to the Bind operation, it is often desirable to use security layers
established by the Bind operation. An extended operation sent after a Bind
operation is protected by the security layers established by the Bind
operation.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.opendj.ldap.messages.Request
Request.RequestType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExtendedRequestDecoder<WhoAmIExtendedRequest,WhoAmIExtendedResult> A decoder which can be used to decode who am I extended operation requests.static final StringThe OID for the who am I extended operation request. -
Constructor Summary
ConstructorsConstructorDescriptionWhoAmIExtendedRequest(List<Control> controls) Creates a newWhoAmIExtendedRequest. -
Method Summary
Modifier and TypeMethodDescriptioncontrols()Returns the value of thecontrolsrecord component.final booleanIndicates whether some other object is "equal to" this one.getOid()Returns the numeric OID associated with this extended request.Returns a decoder which can be used to decoded responses to this extended request.getValue()Returns the value, if any, associated with this extended request.final inthashCode()Returns a hash code value for this object.booleanhasValue()Returnstrueif this extended request has a value.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.forgerock.opendj.ldap.messages.ExtendedRequest
accept, getTypeMethods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOp
addControl, addControls, containsControl, getControl, getControl, removeControls
-
Field Details
-
DECODER
A decoder which can be used to decode who am I extended operation requests. -
OID
The OID for the who am I extended operation request.- See Also:
-
-
Constructor Details
-
WhoAmIExtendedRequest
Creates a newWhoAmIExtendedRequest.
-
-
Method Details
-
getOid
Description copied from interface:ExtendedRequestReturns the numeric OID associated with this extended request.- Specified by:
getOidin interfaceExtendedRequest<WhoAmIExtendedResult>- Returns:
- The numeric OID associated with this extended request.
-
getResultDecoder
Description copied from interface:ExtendedRequestReturns a decoder which can be used to decoded responses to this extended request.- Specified by:
getResultDecoderin interfaceExtendedRequest<WhoAmIExtendedResult>- Returns:
- A decoder which can be used to decoded responses to this extended request.
-
getValue
Description copied from interface:ExtendedRequestReturns the value, if any, associated with this extended request. Its format is defined by the specification of this extended request.- Specified by:
getValuein interfaceExtendedRequest<WhoAmIExtendedResult>- Returns:
- The value associated with this extended request, or
nullif there is no value.
-
hasValue
public boolean hasValue()Description copied from interface:ExtendedRequestReturnstrueif this extended request has a value. In some circumstances it may be useful to determine if an extended request has a value, without actually calculating the value and incurring any performance costs.- Specified by:
hasValuein interfaceExtendedRequest<WhoAmIExtendedResult>- Returns:
trueif this extended request has a value, orfalseif there is no value.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
controls
Returns the value of thecontrolsrecord component.- Specified by:
controlsin interfaceProtocolOp- Returns:
- the value of the
controlsrecord component
-