I am trying to set up a redirect for my Google Cloud Run app. The reason for this is that we have an internal app setup on Google Cloud Run and we have set up a SAML SSO redirection so that when users navigate to the SSO URL, they are asked to perform a sign-in, and then they are redirected to the app's URL.

The problem I have found is that when someone navigates to the app's URL, they are NOT navigated back to the SSO URL to sign in. Maybe the way to get around this is to set up a load balancer where you can specify a URL redirect, but I haven't figured out what I am doing wrong here. The load balancer setup is here:

enter image description here

How can I set this up as simply as possible using GCP Load Balancer to make sure when someone navigates to the app's URL, they are navigated to the SSO URL. When they navigate to the SSO URL, they are asked to sign in and get redirected anyway to the app's URL.

This app is created in R, I know the way I can easily implement the redirection in Dash, but not R.

Thanks and hope this all makes sense, any tips and knowledge would be greatly appreciated here.


Solution 1:

"That logic needs to go inside your application. Except for Google IAP, the load balancer knows nothing about your authentication scheme and whether the user should be redirected to log in or not."

@John Hanley