Determine Oauth2.0 redirect url when using Rstudio Server Pro

We would like to perform Oauth2 authentication in order to grant permission to api's in our shiny apps. While developing the apps, it would be great to allow the oauth dance with a redirect to the localhost like it was sketched by Hadley Wickham in: Sketch of shiny + oauth · GitHub

However, we use Rstudio Server Pro and when we test a shiny app we are not on "localhost" but on a Rstudioserver session. Does anyone know how I can extract the Rstudio Server session url and use that as a redirect url?

You can use rstudioapi::translateLocalUrl to turn a local (localhost) URL into a session URL. Does that do what you want?

https://rdrr.io/cran/rstudioapi/man/translateLocalUrl.html

Thanks a lot Jonathan. This is indeed exactly what I asked for.
Unfortunately, I did not realize that this does not solve my Oauth issue :slight_smile: .

Now with rstudioapi::translateLocalUrl I am able to extract the session specific url, each time different for each session and each user. However, on the Oauth2.0 server we are not allowed to use wildcards and thus we cannot configure a general redirect url.
We figured out the approach for published shiny apps (= fixed redirect url) but I can't seem to find the right solution that allows Oauth2 during shiny app development on the Rstudio Server.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.