Another alternative to this would be to do something like...
/j_acegi_cas_security_check?ticket=ST-{ticket_stuff}&redirectUrl=/redirectToWhereIWantToGoInUrlEncodedForm
and then have Acegi just redirect to the redirectUrl after validating
the ticket.
-Scott
Lucas Opara wrote:
Hello,
I found something that could be useful to add to the
*org.acegisecurity.ui.cas.CasProcessingFilter*.
When working in proxy mode, after receiving a proxy ticket and
validating it to CAS, acegi will always redirect the proxied web
application to its defaultTargetUrl defined in applicationContext.xml
file.
It would be nice if we could pass some extra parameters from the
proxy to this default URL.
A solution would be to append extra parameter to
/j_acegi_cas_security_check?ticket=.... when calling from proxy and to
slightly modify the behaviour of the method *AbstractProcessingFilter.
**successfulAuthentication()* to handle those extra parameters and
append them to the default URL. What do you think?
Cheers,
Lucas Opara
Sample code:
protected void successfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult) {
//....
if (targetUrl == null) {
targetUrl = request.getContextPath() + getDefaultTargetUrl();
//ADDED by LOP 22/02/2006 - BEGIN
Map params = request.getParameterMap();
if(params != null && !params.isEmpty()) {
//other parameters to append to targetUrl
Iterator it = params.entrySet().iterator();
int i=0;
while (it.hasNext()) {
i++;
Map.Entry pair = (Map.Entry)it.next();
if("ticket".equals(pair.getKey())) {
continue;
}
targetUrl += (i==1 ? "?" : "&") + (String)pair.getKey() + "=" +
arrayToString((String[])pair.getValue());
}
}
//ADDED by LOP 22/02/2006 - END
}
//...
}
private String arrayToString(String s[]) {
int k;
String result = "";
k = s.length;
if (k > 0) {
result = s[0];
for (int i= 1 ; i < k; i++) {
result += s[i] ;
}
}
return result;
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer