Search code examples
samlservice-provider

SAML 2.0 service provider implementation


I am implementing SAML2.0 ServiceProvider in java using spring-security-saml-sample code. After successful login response gets redirect to root path(welcome file) of application.How to redirect it to any controller ?

Thanks, Tejas


Solution

  • You can customize URL to which user gets redirected after successful authentication by changing bean successRedirectHandler, for example to:

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