Runable example for "Authentication and database"


do you have templates for managing multiple users in a shiny application, like

(Unfortunately the source is incomplete and will probably be different for shinyproxy)

I’m excited to hear some tips


Hi @ckluss,

If you use the openanalytics/shinyproxy-demo image (e.g. when working through the getting started guide at, it allows to see the group based authorization at work:

  • when you log in as user ‘tesla’ (password ‘password’) who is part of the scientists user group, you will see two applications;
  • if you log in as user ‘gauss’ (password ‘password’) who is part of the mathematicians user group, you will see only one application

This authorization logic is configured in the apps block of the default application.yml file:

(full source at

  - name: 01_hello
    display-name: Hello Application
    description: Application which demonstrates the basics of a Shiny app
    docker-cmd: ["R", "-e shinyproxy::run_01_hello()"]
    docker-image: openanalytics/shinyproxy-demo
    groups: scientists, mathematicians
  - name: 06_tabsets
    docker-cmd: ["R", "-e shinyproxy::run_06_tabsets()"]
    docker-image: openanalytics/shinyproxy-demo
    groups: scientists
  • for the 01_hello application you see groups: scientists, mathematicians
  • for the 06_tabsets application you only see groups: scientists

The definition of which users belong to which groups is done in the LDAP directory.

Hope this helps,

Hi @tverbeke

thank you very much!

Is it possible to query the user name within the application?

session$user seems not to work

Best wishes

Hello @ckluss,

The user name of the authenticated user is made available to the Shiny application via the environment variable SHINYPROXY_USERNAME (from,
so from Shiny you can query it using something along

userName <- Sys.getenv("SHINYPROXY_USERNAME")


Hi @tverbeke

thank you very much that works perfectly!