Skip to content

keyring usage with shiny server on linux #127

@baderstine

Description

@baderstine

I'm running shiny-server on CentOS and want to use the keyring package to store and access passwords.

Given that shiny apps run as shiny user, what is the process for initializing the keyring for shiny apps to utilize?

Here's what I've tried so far:

  1. Login to shiny user,
  2. run R,
  3. keyring::key_set(service = 'svcname', username = 'username', keyring = 'system')
    Now when I do this, it returns a message stating The 'system' keyring does not exist, enter a keyring password to create it: So I enter a password.
  4. go to my shiny server url and run my app

The shiny app wants the password so the code for that in the app is: keyring::key_get(service = 'svcname', username = 'username') but this doesn't work. I get an error in the shiny app's log file which doesn't make any sense. I'm running key_get() and for some reason the error is about setting a password:

Warning: Error in b__file_set_keyring_pass: Aborted setting keyring password
  112: stop
  111: b__file_set_keyring_pass
  110: private$set_keyring_pass
  109: b_file_keyring_unlock
  108: self$keyring_unlock
  107: b_file_get
  106: default_backend()$get
  105: keyring::key_get
...

When I attempt to just run keyring::key_get('svcname', 'username') as the shiny user in an interactive session, I can see that I'm getting a prompt to unlock the 'system' keyring by entering a password. Am I doing something wrong? Running the shiny apps my Mac this 'just works', but from within shiny-server on Linux not so much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions