one of my services need to have custom behavior after a successful 
authentication(need to redirect to different pages based on username)

So I modifed cas-client xml this way:

  <!-- authenticates CAS tickets, must be in custom-filter of cis.xml -->
    <bean id="casFilter"
          class="org.springframework.security.cas.web.CasAuthenticationFilter">
        <property name="authenticationManager" ref="authenticationManager"/>
        <property name="filterProcessesUrl" value="/login"/>

        <property name="authenticationSuccessHandler">
            <bean 
class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler">
                <property name="defaultTargetUrl" value="/"></property>
            </bean>

        </property>
    </bean>


Now In that application I did this:

@Named
public class MySimpleUrlAuthenticationSuccessHandler extends 
SavedRequestAwareAuthenticationSuccessHandler {
    protected final Log logger = LogFactory.getLog(this.getClass());

    private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();

    protected MySimpleUrlAuthenticationSuccessHandler() {
        super();
    }

    // API

    @Override
    public void onAuthenticationSuccess(final HttpServletRequest request, final 
HttpServletResponse response, final Authentication authentication) throws 
IOException {
   //handle the redirect here//
        handle(request, response, authentication);
        
    } 


How ever that method(onAuthenticationSuccess) never called. Any suggestions?

Please remember that some services need to use the default behavior so I cant 
hard code MySimpleUrlAuthenticationSuccessHandler in the cas-client's filter 
xml since it's being shared among all of my services.

Thanks.


-- 
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

Reply via email to