Are you using this in conjunction with the services management tool to
define which services see which attributes? Or have you added the list of
default attributes to the Services Manager implementation (for when you
don't use the services management tool).
-Scott
On Fri, Mar 28, 2008 at 9:38 AM, Shyam Kumar S <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
>
>
> I am trying to use LDAP authentication with CAS. I am able to authenticate
> successfully.
>
>
>
> However, I am having trouble to pick the user's attributes from LDAP.
>
>
>
> I have configured the attributeRepository bean with the class
> org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao as
> follows:
>
>
>
> <bean id="attributeRepository" class="
> org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
>
> <property name="baseDN" value="XXXXXX" />
>
> <property name="query" value="(uid={0})" />
>
> <property name="contextSource" ref="contextSource" />
>
> <property name="ldapAttributesToPortalAttributes">
>
> <map>
>
> <entry key="cn" value="Name"/>
>
> <entry value="Telephone" key="telephoneNumber" />
>
> <entry value="Full Name" key="fullName" />
>
> <entry value="Email" key="mail" />
>
> </map>
>
> </property>
>
> </bean>
>
>
>
> I wrote the following code in a JSP, and there were no attributes in the
> output.
>
> What is wrong here?
>
>
>
> AttributePrincipal principal = ((
> org.jasig.cas.client.validation.AssertionImpl) session.getAttribute(
> "_const_cas_assertion_")).getPrincipal();
>
> out.println("The name of the authenticated user is: " + principal.getName
> ());
>
> out.println("<br>Is the principal object not having any attributes? - " +
> principal.getAttributes().isEmpty());
>
> out.println("<br>");
>
>
>
> Map attributes = principal.getAttributes();
>
> Iterator attributeNames = attributes.keySet().iterator();
>
> out.println("<table>");
>
> *for* (; attributeNames.hasNext();) {
>
> out.println("<tr><th>");
>
> String attributeName = (String) attributeNames.next();
>
> out.println(attributeName);
>
> out.println("</th><td>");
>
> Object attributeValue = attributes.get(attributeName);
>
> out.println(attributeValue);
>
> out.println("</td></tr>");
>
> }
>
> out.println("</table>");
>
>
>
> Let me know what I am missing out. For your information, I have replace
> person-directory-1.0.1.jar with 1.1.1.
>
>
>
> Regards,
>
> Shyam
>
>
>
> ********** DISCLAIMER *******
>
> The information contained in this email is confidential and may contain
> proprietary information. It is meant solely for the intended recipient.
> Access to this email by anyone else is unauthorised. If you are not the
> intended recipient, any disclosure, copying, distribution or any action
> taken or omitted in reliance on this, is prohibited and may be unlawful. No
> liability or responsibility is accepted if information or data is, for
> whatever reason, corrupted or does not reach its intended recipient. Dun &
> Bradstreet PSAPL reserves the right to take any action in accordance with
> its email policy. If you have received this communication in error, please
> delete this mail & notify us immediately at [EMAIL PROTECTED]
>
>
>
> _______________________________________________
> Yale CAS mailing list
> [email protected]
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
--
-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas