Configure Okta Access Gateway to Land on a Post-Login URL with SP-Initiated Login and Deep Linking Enabled
Last Updated:
Overview
Service Provider (SP) initiated logins in Okta Access Gateway (OAG) land on the protected web resource page when deep linking is active, whereas Identity Provider (IdP) logins land on the post-login URL due to the Default Relay State value. Administrators can route users to a specific post-login URL by creating an advanced application policy that redirects to a protected web application resource.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Access Gateway (OAG)
Solution
How does Okta Access Gateway route SP-initiated logins to a post-login URL?
Okta Access Gateway routes users to the requested resource from the protected web URL during an SP-initiated login. If users must land on the post-login URL when deep linking is active, administrators must create a policy that calls the resource configured for redirection.
Configure the redirection policy under the advanced configuration for application policies using the following code snippet.
if ($request_uri = '/') {return 302 /myurl ; }
NOTE: The /myurl path must originate from a protected web application to ensure Okta triggers the authentication process.
