WhoAmIExtendedOperation.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
* Portions Copyright 2011-2015 ForgeRock AS
*/
/**
* This class implements the "Who Am I?" extended operation defined in RFC 4532.
* It simply returns the authorized ID of the currently-authenticated user.
*/
public class WhoAmIExtendedOperation
{
/**
* Create an instance of this "Who Am I?" extended operation. All
* initialization should be performed in the
* <CODE>initializeExtendedOperationHandler</CODE> method.
*/
public WhoAmIExtendedOperation()
{
}
/** {@inheritDoc} */
public void initializeExtendedOperationHandler(
{
}
/** {@inheritDoc} */
{
// Process any supported controls for this operation, including the
// proxied authorization control.
try
{
{
// The requester must have the PROXIED_AUTH privilege in order to be
// able to use this control.
{
return;
}
if(proxyControlV2 != null)
{
}
else
{
// Log usage of legacy proxy authz V1 control.
"obsoleteProxiedAuthzV1Control"));
}
}
}
catch (DirectoryException de)
{
return;
}
// Get the authorization DN for the operation and add it to the response
// value.
{
authzID = "";
}
else
{
}
}
/** {@inheritDoc} */
public String getExtendedOperationOID()
{
return OID_WHO_AM_I_REQUEST;
}
/** {@inheritDoc} */
public String getExtendedOperationName()
{
return "Who Am I?";
}
}