How to return more than username after authentication?

indrit Lavoro indritselimilavoro at yahoo.it
Thu Feb 8 03:27:55 EST 2007


Yes your wright, 
the difference in my case is that we already had sub-classed  the UsernamePasswordCredentials in base of  our application needs. What I have done is to generalize the credentials object to handle fields other then user name and password, so I have sub classed UsernamePasswordCredentials. Actually the info that you want to send to client are application dependent therefore  also the solution is application dependent. In my case I not only I can send but I can also eventually receive other info fields. May be I am missing something but the 
interface method Principal resolvePrincipal(Credentials credentials) receives only a crediantials object and I don't like injecting other services that are not passed as parameters to a method. 

I breaked the xml schema because I added other custom elements within serviceResponse element; the schema doesn't allow other elements then: 
authenticationSuccess
authenticationFailure
proxySuccess
proxyFailure

Yes, you can avoid this wrapping the the default cas xml response format for example:
<new-xml-doc-root> 
  <cas:serviceResponse/>
  <custom:customInfo/>
</new-xml-doc-root>

but what I was saying is that may be a schema extension point would be a better solution.

Best,
Indrit

t ray <t_ray9505 at yahoo.com> ha scritto: Indrit,
 Thanks for your response. I have had to make the following changes-
 - Subclass Principal (new class)
 - Implement CredentialsToPrincipalResolver (new class)
- casServiceValidationSuccess.jsp (add new parameters)
  
 I didn't have to make any changes to the other files you have mentioned. Maybe I am missing something? I also am not sure what changes you had to make to cas-servlet.xml and how that broke xml schema. Could you or someone please explain? I am afraid that I may not have done all changes and that will break something elsewhere...
  
 Thanks,
  
 Ray


 ----- Original Message ----
From: indrit Lavoro <indritselimilavoro at yahoo.it>
To: Yale CAS mailing list <cas at tp.its.yale.edu>
Sent: Wednesday, February 7, 2007 3:01:21 AM
Subject: Re: How to return more than username after authentication?

I have already done something like this but what I observed is that I breaked  the xml schema related to the 'http://www.yale.edu/tp/cas' namespace.  I made changes to the following files on the server side( that I remember ) :

- UsernamePasswordCredentials  (subclass)
- CredentialsBinder  (implement)
- SimplePrincipal (subclass)
- CredentialsToPrincipalResolver (implement)
- CasServlet.xml (changes to authenticationViaFormAction)
- casServiceValidationSuccess.jsp (add new parameters)

May be for the xml community is necessary to create an extending point to the related W3CSchema  for the response's xml format.

Best,

Indrit





"Stephen A. Cochran" <stephen.a.cochran at dartmouth.edu> ha scritto: 
On Feb 2, 2007, at 5:34 PM, t ray wrote:

> Is it possible (and advisable) to return than just the username 
> after successful login? I would like to be able to return a small 
> amount of user data apart from the name such that this extra 
> information is also available along with the user name.

Dartmouth has extended the standard CAS 2.0 XML response to include 
some non-standard attributes. This involves extending some of the 
classes in the server, as well as updating the clients to present 
these new fields to users.

The archives of this mailing list should contain a fairly detailed 
description of the design we chose.

Steve Cochran
Dartmouth College
_______________________________________________
Yale CAS mailing  list
cas at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas

  

---------------------------------
 Vinci i biglietti per FIFA World Cup in Germania! _______________________________________________
Yale CAS mailing list
cas at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas

 



  
---------------------------------
Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster._______________________________________________
Yale CAS mailing list
cas at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas


 		
---------------------------------
 L'email della prossima generazione? Puoi averla con la  nuova Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20070208/4460e3f8/attachment.html 


More information about the cas mailing list