com.sun.jndi.ldap.ext
Class WhoAmIRequest

java.lang.Object
  extended by com.sun.jndi.ldap.ext.WhoAmIRequest
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.ExtendedRequest

public class WhoAmIRequest
extends java.lang.Object
implements javax.naming.ldap.ExtendedRequest

This class implements the LDAPv3 Extended Request for WhoAmI. The WhoAmIRequest and WhoAmIResponse are used to obtain the current authorization identity of the user. WhoAmI extended operation allows users to get authorization identity seperately from LDAP bind operation, unlike AuthorizationIDControl which has to be used with LDAP bind operation.

The WhoAmI LDAP extended operation is defined in draft-zeilenga-ldap-authzid-08.

The object identifier used by WhoAmI extended operation is 2.16.840.1.113730.3.4.15 and the extened request has no value.

The following code sample shows how the extended operation may be used:


     // create an initial context using the supplied environment properties
     LdapContext ctx = new InitialLdapContext(env, null);

     // perform the extended operation
     WhoAmIResponse whoAmI =
         (WhoAmIResponse) ctx.extendedOperation(new WhoAmIRequest());

     System.out.println("I am <" + whoAmI.getAuthorizationID() + ">");

 

Author:
Vincent Ryan
See Also:
WhoAmIResponse, AuthorizationIDControl, Serialized Form

Field Summary
static java.lang.String OID
          The WhoAmI extended request's assigned object identifier is 1.3.6.1.4.1.4203.1.11.3.
private static long serialVersionUID
           
 
Constructor Summary
WhoAmIRequest()
          Constructs a WhoAmI extended request.
 
Method Summary
 javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String id, byte[] berValue, int offset, int length)
          Creates an extended response object that corresponds to the LDAP WhoAmI extended request.
 byte[] getEncodedValue()
          Retrieves the WhoAmI request's ASN.1 BER encoded value.
 java.lang.String getID()
          Retrieves the WhoAmI request's object identifier string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OID

public static final java.lang.String OID
The WhoAmI extended request's assigned object identifier is 1.3.6.1.4.1.4203.1.11.3.

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

WhoAmIRequest

public WhoAmIRequest()
Constructs a WhoAmI extended request.

Method Detail

getID

public java.lang.String getID()
Retrieves the WhoAmI request's object identifier string.

Specified by:
getID in interface javax.naming.ldap.ExtendedRequest
Returns:
The non-null object identifier string.

getEncodedValue

public byte[] getEncodedValue()
Retrieves the WhoAmI request's ASN.1 BER encoded value. Since the request has no defined value, null is always returned.

Specified by:
getEncodedValue in interface javax.naming.ldap.ExtendedRequest
Returns:
The null value.

createExtendedResponse

public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String id,
                                                                 byte[] berValue,
                                                                 int offset,
                                                                 int length)
                                                          throws javax.naming.NamingException
Creates an extended response object that corresponds to the LDAP WhoAmI extended request.

Specified by:
createExtendedResponse in interface javax.naming.ldap.ExtendedRequest
Throws:
javax.naming.NamingException - if cannot create extended response due to an error