Redirect with encoded query string

I have a URL that redirects to an authentication provider for SSO, that then redirects to an application at a slightly different URL (long story short, Atlassian’s custom domain are whacky and so is there SSO implementation).

I’d like to be able to redirect a specific hostname to a redirect URL where the query string is passed onto the redirect URL as an encoded parameter. Like, redirect_url=somedomain.tld%2Fsub%2Fpage.

I was able to achieve this using a Page Redirect Rule. The solution was to use concat, manually define the encoded URL FQDN, and then append the URI Path (which isn’t encoded, but still works).

Here’s an example expression of how we redirect Atlassian Jira Service Management Help Center links from our own custom vanity subdomain, forcing authentication in the process (to avoid Atlassian’s terrible SSO prompt), and then redirecting to a specific article.

concat("https://id.atlassian.com/login/saml/start?connection=SAML-STRING-HERE&application=jira&continue=https%3A%2F%2Finternal.help.domain.com", http.request.uri.path)

The original example link:
https://help.domain.com/sub/1234/article/content

which redirects to (for SSO):
https://id.atlassian.com/login/saml/start?connection=SAML-STRING-HERE&application=jira&continue=https%3A%2F%2Finternal.help.domain.com/sub/1234/article/content

which eventually redirects to:
https://internal.help.domain.com/sub/1234/article/content

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.