openanalytics / shinyproxy

ShinyProxy - Open Source Enterprise Deployment for Shiny and data science apps
https://www.shinyproxy.io
Apache License 2.0
513 stars 152 forks source link

Redirect to correct app upon login #420

Closed DmitryPustovit closed 1 year ago

DmitryPustovit commented 1 year ago

Hello!

I have a ShinyProxy instance set up that's running login with an openid provider. Upon trying to access an app app/MyCoolApp I get redirected to login. After I login, I get redirect to the landing with all available apps. I understand there is a landing-page parameter however, I do not want to redirect to a specific app but to whatever app the user was trying to access.

Is this something that is supported or could be supported in the future?

Thanks!

LEDfan commented 1 year ago

This is indeed the current behavior. In the past shinyproxy actually (tried) to redirect back to the original page. However, this often gave problems, such as the user ending up on the wrong page or an internal request (js/css/ajax). Therefore we decided to always redirect to the main page after login.

I'll keep this issue open as a feature request, we'll check if we can improve this again.

ei-ds commented 1 year ago

Hi,

Thanks for the updates on ShinyProxy. We highly appreciate your active development!

However, we also need the old behavior back. The current behavior leads to serious confusion at our customers side who expect to directly access an app with the correct URL and not having to search for it after logging in.

Thanks

LEDfan commented 1 year ago

Hi

Thanks for the feedback. We fixed some issues w.r.t. authentication and tried to fix this issue as well. With the fix, shinyproxy will now redirect to the app again. However, it still does not redirect back to non-app pages, in order to prevent the issue where you can end up on some internal/api endpoint.

You can try this build using the docker image openanalytics/shinyproxy-snapshot:3.0.2-SNAPSHOT-20230515.131226 or using the following jar: https://nexus.openanalytics.eu/repository/snapshots/eu/openanalytics/shinyproxy/3.0.2-SNAPSHOT/shinyproxy-3.0.2-20230515.131226-3.jar

I'm looking forward to your feedback!

Oxians commented 1 year ago

Hello. Thank you for looking into this!

We have a similar use case:

Some details, for the results when the user is redirected to the login:

Please let us know if we can work around this issue or if the return of this feature is forthcoming. Also, as this is a bit wider then the originally reported issue (application+query params vs just application), let me know if I should create a separate issue instead.

LEDfan commented 1 year ago

Hi @Oxians

Thanks for the detailed explanation of your issue. When using SAML, the original URL is only saved when you change same-site-cookie to None. Note that is option requires that your are using SSL and you have secure cookies enabled. See the documentation here: https://shinyproxy.io/documentation/configuration/#samesitecookies-and-saml

Enabling this option wasn't required when using version 2.5.0. It should work when you enable above options and use the snapshot version. Please let us know whether this works in your situation, I'll update the SAML documentation as soon was make a new release.

Oxians commented 1 year ago

@LEDfan Thank you for the on point guidance!

I can confirm that the application and the query parameters are maintained when:

Looking forward to the next release.

DmitryPustovit commented 1 year ago

@LEDfan Thanks so much for taking a look at this! Is there any chance the change could be pushed to this github repo? General policy that does not allow usage of images off nexus without source code being available.

Thanks again!

ei-ds commented 1 year ago

@LEDfan Excuse my late response, there were a lot of other things with a higher priority in the last weeks.

I can confirm that redirection to the app after login with a direct link to an app works with your latest snapshot.

LEDfan commented 1 year ago

We just released ShinyProxy 3.0.2 which includes this fix, therefore I'm closing this issue.