0

How can we capture the REQUEST_URI into an Apache variable and after third party SSO authentication?

We have a third party SSO authentication in place, which is working fine. After successful authentication, the third-party tool redirects to our main application (mainApp) along with a few HTTP header variables. The successful URL mapped in SSO redirect is https://example.com/mainApp/*.

For Example:
User requests URL: https://example.com/mainApp/page=123 => Goes to SSO Authentication => Redirects to our application URL with http header variable => https://example.com/mainApp/page=123.

High level Architecture is
Apache => SSO Auth => Tomcat Application

But we have a new sub-application after our main app. For example https://example.com/mainApp/appA/page=123, since the third-party SSO always redirects to the main application which is mainApp, how can we capture the user request URL and redirect to the original request?

The current setting is done in the vhosts file with <Location /mainApp>.

Is it possible to capture the REQUEST_URI into an Apache variable before hitting the SSO auth and after successful auth; Substitute into main app URL, And redirect to user request URL which is our sub-application? Basically, we want to substitute the sub application after SSO Auth.

I appreciate anyone's help.

MrWhite
  • 12,647
  • 4
  • 29
  • 41
Rose Wood
  • 1
  • 1
  • "capture the REQUEST_URI into an Apache variable" - It's a bit confusing referring to REQUEST_URI throughout your post, since this is already an "Apache variable"? "before hitting the SSO auth and after successful auth" - before _and_ after? Isn't the URL that you need to redirect to already sent back in an "http header" from the SSO process? How does this interact/conflict with the "sub-application"? – MrWhite Feb 12 '21 at 02:06
  • Thank you so much. Sorry, I typed in hurry. You are right it’s an already Apache Variable. We have a successful URL hardcoded in SSO configuration; which is our main app like this: https://example.com/mainApp/page=123 (1*). After successful authentication, it is redirecting to the main app (1*) We have a sub-app (/appA) under the main app, example https://example.com/mainApp/appA/page=123 (2*) When the user hits the sub-app URL (2*); after successful authentication, the SSO is redirecting to the main application URL (1*) instead of sub-application (2*). How to redirect to sub app. – Rose Wood Feb 12 '21 at 03:08

0 Answers0