shinyproxy-docker-compose-example icon indicating copy to clipboard operation
shinyproxy-docker-compose-example copied to clipboard

Using Keycloak

Open vanhry opened this issue 4 years ago • 1 comments

Hi! Can I use app-in-compose with Keycloak, I am concerned if it would be possible, because users use the same application, and will it be possible to identify users with SHINYPROXY_USERNAME? I will appreciate any help from your side!

vanhry avatar Oct 12 '21 14:10 vanhry

I assume you were asking the app-in-compose case.

Yes, that's correct but it's different from a "normal" ShinyProxy application where SHINYPROXY_USERNAME is an environment variable. In the app-in-compose case, you need to add something like below to nginx.conf:

proxy_set_header  SHINYPROXY_USERNAME "${SHINYPROXY_USERNAME}";
proxy_set_header  SHINYPROXY_USERGROUPS "${SHINYPROXY_USERGROUPS}";

then, you can get the user name in the shiny app by:

 user_info <- session$request$HTTP_ SHINYPROXY_USERNAME


shrektan avatar Nov 08 '21 15:11 shrektan