openanalytics / shinyproxy

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

Example for Shiny app reading HTTP headers #487

Closed corey-dawson closed 6 months ago

corey-dawson commented 6 months ago

With the new container initialization functionality, username and access groups are no longer set as ENVs in the container, but can be sent as HTTP headers. Is there a shiny example of a shiny app that reads the http headers that can be used to incorporate "initialized containers" functionality? Thanks in advance

LEDfan commented 6 months ago

Hi, thanks for your interest! We will provide a full example soon, in the meantime, you can access the usernames through the session object like this:

session$request$HTTP_X_SP_USERID
session$request$HTTP_X_SP_USERGROUPS
LEDfan commented 6 months ago

We just published a demo for this: https://github.com/openanalytics/shinyproxy-shiny-demo-auth I'll close this issue, but of course feedback is welcome!