We want to get the full DN of logged in user using Puma Profile or JSP EL in theme. Please let us know which attribute we should use?
If user1 is logged in we want to get full DN like uid=user1,ou=org1,dc=dx,dc=com
We want to get the full DN of logged in user using Puma Profile or JSP EL in theme. Please let us know which attribute we should use?
If user1 is logged in we want to get full DN like uid=user1,ou=org1,dc=dx,dc=com
Hi Mohammad,
that should be possible to get by PUMA-API, when you try to follow the sample as described in technote:
Portal Sample Code using PUMA API within a WCM JSP component to print out the user and hostname sending the request
and...
Troubleshooting ClassCastException: com.ibm.wps.puma.User incompatible with com.ibm.portal.puma.User
Using...
PumaHome service = (PumaHome) psh.getPortletService(PumaHome.class);
PumaProfile pp = service.getProfile();
User user = pp.getCurrentUser();
String user_objid = pp.getIdentifier(user); }
If you just get the short name of the user using that approach, you can also try to get the full DN from the PumaProfile (check in how to get the different attributes). Maybe also check package: PumaEnvironment
Another approach is to directly get that from the com.ibm.websphere.servlet.session.IBMSession class as described in SessionValidationFilter example and Sample to create a Custom Login/Logout Filter in HCL Portal
IBMSession ibmsession = (IBMSession)req.getSession();
//the IBMSessin object return the username in the following format:
//user:defaultWIMFileBasedRealm/uid=wpsadmin,o=defaultWIMFileBasedRealm
String userID=ibmsession.getUserName();</code></pre>
I hope that hints help.
with best regards
Thorsten
Thanks Thorsten. profile.getIdentifier(user) gives the required information.