Thanks very much Jérôme,

I had worked this out by digging into the CAS code and comments.

For those who want to do something similar, don't forget
to set the "available" attributes in the configuration file,
and select them for the appropriate application via the "service" management 
console,
otherwise, although they are retrieved, they will not be carried to the client 
side.

Cheers
Georges


-----Original Message-----
From: jleleu [mailto:[email protected]] 
Sent: jeudi, 21. juillet 2011 15:41
To: [email protected]
Subject: re:[cas-dev] user attributes

Hello Georges,

I imagine you're using QueryDatabaseAuthenticationHandler as an handler and 
UsernamePasswordCredentialsToPrincipalResolver as a resolver (defined in your 
deployerConfigContext.xml).
If you want to return additionnal user attributes to the cas client 
application, you have to use SAML validation on client side (url /samlValidate 
on server side) and set in your resolver a specific attributeRepository object 
(server side).
By default, the attributeRepository embedded in your resolver adds no 
attribute, but you can use a specific one to retrieve data from DB : 
SingleRowJdbcPersonAttributeDao class or MultiRowJdbcPersonAttributeDao class 
(package org.jasig.services.persondir.support.jdbc).
So, in your deployerConfigContext.xml, you have to create a new bean 
attributeRepository with your SQL information :
  <bean id="attributeRepository" 
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
  ...
  </bean>
and add it to your resolver :
  <bean id="authenticationManager" 
class="org.jasig.cas.authentication.AuthenticationManagerImpl">
    <property name="credentialsToPrincipalResolvers">
      <list>
        <bean 
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver">
          <property name="attributeRepository" ref="attributeRepository" />
        <bean>
  ...

Regards,
Jerome

-- 
You are currently subscribed to [email protected] as: [email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

Reply via email to