|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.Control
com.unboundid.ldap.sdk.controls.ProxiedAuthorizationV1RequestControl
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ProxiedAuthorizationV1RequestControl
This class provides an implementation of the proxied authorization V1
request control, which may be used to request that the associated operation
be performed as if it had been requested by some other user. It is based on
the specification provided in early versions of the
draft-weltman-ldapv3-proxy Internet Draft (this implementation is based on
the "-04" revision). Later versions of the draft, and subsequently
RFC 4370, define a second
version of the proxied authorization control with a different OID and
different value format. This control is supported primarily for legacy
purposes, and it is recommended that new applications use the
ProxiedAuthorizationV2RequestControl
instead if this version.
The value of this control includes the DN of the user as whom the operation
should be performed. Note that it should be a distinguished name, and not an
authzId value as is used in the proxied authorization V2 control.
This control may be used in conjunction with add, delete, compare, delete,
extended, modify, modify DN, and search requests. In that case, the
associated operation will be processed under the authority of the specified
authorization identity rather than the identity associated with the client
connection (i.e., the user as whom that connection is bound). Note that
because of the inherent security risks associated with the use of the proxied
authorization control, most directory servers which support its use enforce
strict restrictions on the users that are allowed to request this control.
Note that while the directory server should return a
ResultCode.AUTHORIZATION_DENIED
result for a proxied authorization V2
control if the requester does not have the appropriate permission to use that
control, this result will not necessarily be used for the same condition with
the proxied authorization V1 control because this result code was not defined
until the release of the proxied authorization V2 specification.
code.
There is no corresponding response control for this request control.
// Create a delete request to delete an entry. Include the proxied // authorization v1 request control in the delete request so that the // delete will be processed as user // "uid=alternate.user,ou=People,dc=example,dc=com" instead of the user // that's actually authenticated on the connection. DeleteRequest deleteRequest = new DeleteRequest("uid=test.user,ou=People,dc=example,dc=com"); deleteRequest.addControl(new ProxiedAuthorizationV1RequestControl( "uid=alternate.user,ou=People,dc=example,dc=com")); LDAPResult deleteResult; try { deleteResult = connection.delete(deleteRequest); // If we got here, then the delete was successful. } catch (LDAPException le) { // The delete failed for some reason. In addition to all of the normal // reasons a delete could fail (e.g., the entry doesn't exist, or has one // or more subordinates), proxied-authorization specific failures may // include that the authenticated user doesn't have permission to use the // proxied authorization control to impersonate the alternate user, that // the alternate user doesn't exist, or that the alternate user doesn't // have permission to perform the requested operation. deleteResult = le.toLDAPResult(); ResultCode resultCode = le.getResultCode(); String errorMessageFromServer = le.getDiagnosticMessage(); }
Field Summary | |
---|---|
static java.lang.String |
PROXIED_AUTHORIZATION_V1_REQUEST_OID
The OID (2.16.840.1.113730.3.4.12) for the proxied authorization v1 request control. |
Constructor Summary | |
---|---|
ProxiedAuthorizationV1RequestControl(Control control)
Creates a new proxied authorization v1 request control which is decoded from the provided generic control. |
|
ProxiedAuthorizationV1RequestControl(DN proxyDN)
Creates a new proxied authorization V1 request control that will proxy as the specified user. |
|
ProxiedAuthorizationV1RequestControl(java.lang.String proxyDN)
Creates a new proxied authorization V1 request control that will proxy as the specified user. |
Method Summary | |
---|---|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available. |
java.lang.String |
getProxyDN()
Retrieves the DN of the target user under whose authorization the associated request should be performed. |
void |
toString(java.lang.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, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROXIED_AUTHORIZATION_V1_REQUEST_OID
Constructor Detail |
---|
public ProxiedAuthorizationV1RequestControl(java.lang.String proxyDN)
proxyDN
- The DN of the target user under whose authorization the
associated request should be performed. It must not be
null
, although it may be an empty string to
request an anonymous authorization.public ProxiedAuthorizationV1RequestControl(DN proxyDN)
proxyDN
- The DN of the target user under whose authorization the
associated request should be performed. It must not be
null
.public ProxiedAuthorizationV1RequestControl(Control control) throws LDAPException
control
- The generic control to be decoded as a proxied
authorization v1 request control.
LDAPException
- If the provided control cannot be decoded as a
proxied authorization v1 request control.Method Detail |
---|
public java.lang.String getProxyDN()
public java.lang.String getControlName()
getControlName
in class Control
public void toString(java.lang.StringBuilder buffer)
toString
in class Control
buffer
- The buffer to which to append the string representation of
this buffer.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |