Setting shiny.user from code?

Hi,

Is it possible to set the Shiny.user variable from within a shiny app?
I would like to set it based on the header (HTTP_X_AUTH_USERNAME) that is passed into Shiny so that I can take advantage of the user tracking example in https://shiny.rstudio.com/articles/usage-metrics.html

Setting the session$user directly in the server function didn't seem to work.

Thanks,

Iain

You can do this if you are using Shiny Server Pro: http://docs.rstudio.com/shiny-server/#proxied-authentication If not, you would have to get that variable to the client some other way besides session$user/Shiny.user.

1 Like

Fantastic, thanks. It appears a similar approach works for Rstudio Connect.

1 Like