Entry authorizationEntry;
try
{
ProxiedAuthV1Control proxyControlV1 =
operation.getRequestControl(ProxiedAuthV1Control.DECODER);
ProxiedAuthV2Control proxyControlV2 =
operation.getRequestControl(ProxiedAuthV2Control.DECODER);
if(proxyControlV1 != null || proxyControlV2 != null)
{
// The requester must have the PROXIED_AUTH privilige in order to
// be able to use this control.
if (! clientConnection.hasPrivilege(Privilege.PROXIED_AUTH,
operation))
{
operation.appendErrorMessage(
ERR_EXTOP_WHOAMI_PROXYAUTH_INSUFFICIENT_PRIVILEGES.get());
operation.setResultCode(ResultCode.AUTHORIZATION_DENIED);
return;
}
if(proxyControlV2 != null)
{
authorizationEntry = proxyControlV2.getAuthorizationEntry();
}
else
{
authorizationEntry = proxyControlV1.getAuthorizationEntry();
}