I hesitate to argue with Jerome but I would suggest a different approach:

Rather than hacking into the CAS webflow, why don't you just create a landing 
page/url for your users.  That page is CAS protected and once the user has 
logged in is responsible for looking at user attributes from CAS and then 
forwarding to the right start page for that user.   You can build this with 
whatever technology you want in any way that you want, and you can use a stock 
CAS server without a custom webflow.

So the flow is something like this:

1) Users click on your "start URI".

2) User is fowarded to CAS by CAS client protecting "start URI"

3) User logs in (or has already logged in)

4) User is forwareded back to the "start URI" with ST

5) CAS client at "start URI" validates ST and get's user attributes.

6) Actual implementation of start URI looks at user attributes and forwards to 
appropriate App (say app1)

7) Cas client at app1 forwards to CAS

8) CAS forwards back to app1 with ticket

9) CAS client at app1 validates ticket

10) Presto, you are at app1.

David Ohsie
Software Architect
EMC Corporation




> -----Original Message-----
> From: shibaram [mailto:[email protected]]
> Sent: Monday, July 08, 2013 11:09 AM
> To: [email protected]
> Subject: Re:[cas-user] How to get userid and other attributes in a custom
> controller on cas serverside
> 
> Thank you Jerome for your input through email as below:
> 
> jleleu wrote
> > Hi,
> >
> > I would modify the CAS server in two places :
> > - at authentication, fetch the siteurl when authenting users and save
> > it as an authentication parameter : might be done in a specific
> > authentication handler or via an appropriate metadatapopulator
> > - change the webflow to rely on a custom redirect action which uses
> > the siteurl for redirection (and not the provided service).
> >
> > Best regards,
> > Jérôme
> 
> But I am very much new to these technologies.
> Can you please give me some examples or some sample code which files I
> need to touch and what are the changes I need to make.
> I am not known to spring webflow even. Please guide me.
> 
> I have configured my "deployerConfigContext.xml" to have the
> "attributeRepository" bean to use a custom
> SingleRowJdbcPersonAttributeDao.
> 
>       <bean id="attributeRepository"
>               class="com.rsi.cas.server.UserAttributesDao">
>               <constructor-arg index="0" ref="dataSource" />
>               <constructor-arg index="1"
>                       value="select * from users where {0}" />
>               <property name="queryAttributeMapping">
>                       <map>
>                               <entry key="username"
> value="usruserlogin" />
>                       </map>
>               </property>
> 
>               <property name="resultAttributeMapping">
>                       <map>
>                               <entry key="usruserlogin"
> value="userloginId" />
>                               <entry key="usruserfirstname"
> value="ufname" />
>                               <entry key="usrsiteid" value="usite" />
>                       </map>
>               </property>
>       </bean>
> 
> Attached are my "deployerConfigContext.xml", UserAttributesDao.java files:
> 
>   deployerConfigContext.xml
> <http://jasig.275507.n4.nabble.com/file/n4660162/deployerConfigContext.x
> ml>
> UserAttributesDao.java
> <http://jasig.275507.n4.nabble.com/file/n4660162/UserAttributesDao.java>
> 
> 
> 
> --
> View this message in context: http://jasig.275507.n4.nabble.com/How-to-
> get-userid-and-other-attributes-in-a-custom-controller-on-cas-serverside-
> tp4660155p4660162.html
> Sent from the CAS Users mailing list archive at Nabble.com.
> 
> --
> 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-user
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to