Skip Navigation
Expand
Redirect a user on customer portal after SSO authentication
Answer ID 11788   |   Last Review Date 10/03/2023

How do I redirect a user back to a specific end user page or form after SSO authentication?  

Environment: 

Customer Portal Single Sign-On

Issue:

Users always land on Customer Portal home page after SSO authentication.

We want the users to be redirected to the original page they tried to visit.

Resolution:

By default, customer portal does not process the relay state or support deep linking.  If you want to redirect the user to a specific page after authentication, you have two options;

  • Pass the redirect in the ACS URL.  By default, the user will be directed to the Home page after authentication.  You can specify a different page to direct the user after authentication.  Please see How You Redirect Contacts After Login.  Users will always be redirected to the page specified in the redirect. 
  • The other option is to create a pre_login hook or post_login hook to intercept the SAML response and parse out the relay state.  Relay states are not looked at in Customer Portal unless a customization is built.  If you build this type of customization, users will be redirected to the exact page they were originally trying to access after they authenticate with the identity provider.  
Documentation for hooks can be found in Customer Portal Developer Adding Hooks documentation.  Example hooks can be found on the hooks.php file via /cp/customer/development/config/hooks.php. Documentation for models can be found in Customer Portal Developer Overview of Creating Models documentation..  There are a few example models to help you in building a custom model for your hook.  The example models can be found in customer portal development environment via cp/customer/development/models/custom.