Accessing User information from JSR 168 portlet

Accessing a logged in user name in portal using JSR168 is straightforward and it is request.getRemoteUser() but in some cases you might need additional user attributes like
first name, last name, given name etc.

If you want to access such additional users information which is normally stored in coroporate directory in JSR-168 compliant way then use these steps.

At deployment time the portal can map the requested user profile attributes to the supported profile attributes or the portal can ignore the requested attributes.

In some scenarios, you might need to access following information
-Portal group name of user to which he belongs
-All portal groups in portal
-All users for a perticular portal group.
-List of users who belongs to multiple groups....

If this kind of requirement is for IBM WebSphere portal, you can access all these info using PUMA API.