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
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
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>
If you're looking for the general way to maintain state through the login process, SAML2 is expected to preserve the RelayState
variable (pass it alongside the SAMLRequest
). Put whatever you'd like in it. I like base64'd json.