Peter
Peter

Reputation: 493

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

Upvotes: 0

Views: 879

Answers (2)

Rob Starling
Rob Starling

Reputation: 3908

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.

Upvotes: 0

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>

Upvotes: 1

Related Questions