How to store data from the Authentication in the Principal

Scott Battaglia scott.battaglia at gmail.com
Fri Nov 23 01:33:25 EST 2007


The default implementation of the Attribute code only works if you also
configure an appropriate service using the Services Management tool.  CAS is
designed to only send back attributes if a service in the Service Management
tool is configured to accept those attributes.

Services in the Services Management tool can be configured using Ant Pattern
Matching so the definition of a service is pretty broad.

-Scott

On Nov 22, 2007 11:38 PM, dale77 <Dale.Ogilvie at trimble.co.nz> wrote:

>
> So here's what I've tried so far - which is not working as I'd like. I am
> trying to demonstrate that attributes added to the principal can flow
> through to the service validation response.
>
> In deployerConfigContext.xml, I've wired up a dummy attributeRepository to
> the standard resolver:
>
> <bean
> class="
> org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver
> ">
> <property name="attributeRepository">
> <ref bean="attribRepository" />
> </property>
> </bean>
>
> <bean id="attribRepository"
> class="org.jasig.services.persondir.support.StubPersonAttributeDao">
> <property name="backingMap">
> <map>
> <entry key="uid" value="uid" />
> <entry key="eduPersonAffiliation" value="eduPersonAffiliation" />
> <entry key="groupMembership" value="groupMembership" />
> </map>
> </property>
> </bean>
>
> Then, I'm expecting to be able to access a "uid" item in the principal's
> attribute map in the service ticket validation response, so I modified
> casServiceValidationSuccess.jsp as below:
>
> ...
> <cas:authenticationSuccess>
> <cas:user>${fn:escapeXml(assertion.chainedAuthentications[fn:length(
> assertion.chainedAuthentications)-1].principal.id)}</cas:user>
> <cas:uid>${fn:escapeXml(assertion.chainedAuthentications[fn:length(
> assertion.chainedAuthentications)-1].principal.attributes.uid)}</cas:uid>
> ...
>
> However the uid in the response is empty.
>
> <cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
> <cas:authenticationSuccess>
> <cas:user>Dale.Ogilvie at trimble.co.nz</cas:user>
> <cas:uid />
> </cas:authenticationSuccess>
> </cas:serviceResponse>
>
> Anyone know what I'm doing wrong? Perhaps this is just wrong-headed....
>
> Thanks
>
> Dale
> --
> View this message in context:
> http://www.nabble.com/How-to-store-data-from-the-Authentication-in-the-Principal-tf4859467.html#a13906933
> Sent from the CAS Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>



-- 
-Scott Battaglia

LinkedIn: http://www.linkedin.com/in/scottbattaglia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20071123/93919c7c/attachment.html 


More information about the cas mailing list