I need send certain attributes(say, human readable user name) from server to
client after a successful authentication. Server part was done. Now attribute was sent to
client. From log, I can see:
2010-03-28 23:48:56,669 DEBUG
Cas20ServiceTicketValidator:185 -
Server response:
[email protected]
<cas:proxyGrantingTicket>PGTIOU-1-QZgcN61oAZcunsC9aKxj-cas</cas:proxyGrantingTicket>
<cas:attributes>
<cas:FullName>Test account 1</cas:FullName>
</cas:attributes>
</cas:authenticationSuccess> </cas:serviceResponse>
Yet, I don't know how to access the attribute in client(I am using Spring security 2.0.5).
In authenticationProvider, a userDetailsService is configured to read db for authenticated principal.
<bean id="casAuthenticationProvider" class="org.springframework.security.providers.cas.CasAuthenticationProvider">
<sec:custom-authentication-provider />
<property name="userDetailsService" ref="clerkManager"/>
<!-- other stuff goes here -->
</bean>
Now in my controller, I can easily do this:
Clerk currentClerk = (Clerk)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
Ideally, I can fill the attribute to this Clerk object as another property in some way. How to do this?
Or what is recommended approach to share attributes across all apps under CAS's centralized nature?