Output an LDAP user's common name (cn) on my JSP... HELP
Dear all,
I need help on the following:
I am using LDAP with Spring Security/Acegi
In my JSP, i need to output 2 things: (a) Username and (b) Common Name of the authenticated user
For (a) i've used <auth:authentication operation="username"/> to output the username correctly.
For (b) I've tried to use <auth:authentication operation="attributes"/> to access the attributes of the user and then get his/her Common Name (cn) but i don't know how to do that :(
Example: <auth:authentication operation="attributes"/> produces {givenname=givenname: John, sn=sn: Bravo, userpassword=userpassword: [B@13d5f21, mail=mail: johnny.bravo@bravo.com, objectclass=objectClass: organizationalPerson, person, inetOrgPerson, top, uid=uid: bravoj, cn=cn: Johnny Bravo, description=description: Actor}
My problem: How to output the Common Name (cn) only?!???!
Please help