shinyauthr | R package with shiny authentication modules | Data Visualization library
kandi X-RAY | shinyauthr Summary
kandi X-RAY | shinyauthr Summary
shinyauthr is an R package providing module functions that can be used to add an authentication layer to your shiny apps. It borrows some code from treysp's shiny_password template with the goal of making implementation simpler for end users and allowing the login/logout UIs to fit easily into any UI framework, including shinydashboard. To enable cookie-based authentication in browsers, it also borrows code from calligross's Shiny Cookie Based Authentication Example and from an earlier PR from aqualogy.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of shinyauthr
shinyauthr Key Features
shinyauthr Examples and Code Snippets
Community Discussions
Trending Discussions on shinyauthr
QUESTION
I'm working on a shinyapp which fetches data from a database via a pool from the pool package. I'm working on a login page via shinyauthr where the usernames correspond to the names of the tables in the pool (all users will only be allowed to fetch data that correspond to their username).
I haven't been able to understand how I obtain the user name in shinyauthr. I've looked at https://github.com/paulc91/shinyauthr and Reactive Filtering Based on User Login - Shinyauthr but I'm still struggling to understand how to proceed.
To exemplify, I've created a similar situation where I, instead of choosing table in a pool, choose a column in a df. On row 50, I want user_data
to store the user name from credentials
in order to filter df
on row 55. I have tried several reactive arguments of which none have worked.
ANSWER
Answered 2020-Nov-17 at 10:20The information you're looking for is stored in credentials()$info$user
. I've used this to create the reactive user_data
, but you could also use it directly.
QUESTION
Note: This (lengthy) question is a follow-up to my previous post.
I would like to achieve the encryption of data locally (local RStudio) and decrypt the encrypted data remotely (application hosted on shinyapps.io).
The first part of the code intrinsically encrypts a data-frame using a key
. The second part of the code is a shiny application that decrypts the data-frame using the same key
and thereby using this data-frame for authentication purposes within the application. The code works just alright on my machine.
However, it throws an error when published to shinyapps.io (cloud-based hosting service) as shown below:
1.Code for encrypting the data-frame.
...ANSWER
Answered 2020-Mar-13 at 08:16Reason for the issue
The problem is by design as cyphr::key_sodium
creates a key which is valid, well, only for the current session. That is, it is not possible to share it across different session let alone different systems.
Hence, the problem is not at all related to shiny
itself, but to the fact that you are trying to use cyphr
keys across different sessions.
From the vignette:
When using key_openssl, keypair_openssl, key_sodium, or keypair_sodium we generate something that can decrypt data. The objects that are returned by these functions can encrypt and decrypt data and so it is reasonable to be concerned that if these objects were themselves saved to disk your data would be compromised.
To avoid this, cyphr does not store private or symmetric keys directly in these objects but instead encrypts the sensitive keys with a cyphr-specific session key that is regenerated each time the package is loaded. This means that the objects are practically only useful within one session, and if saved with save.image (perhaps automatically at the end of a session) the keys cannot be used to decrypt data.
Reprex of the issue
QUESTION
I have a QA Shiny Dashboard app that has a master dataset that must filter the rows used in subsequent tables / maps according to user login details.
For example: if the user logs in with a particular username (location@email.com) then the reactive function selects rows that contain this username and passes these to the shiny app for rendering.
Example of basic premise:
...ANSWER
Answered 2020-Feb-18 at 19:09As often happens in these cases, a lot of wrangling finally led to an answer but I will post my solution here in case anyone runs into a similar issue.
R2Evans was correct in that it can be called with credentials()$info. The issue was trying to use eventReactive, rather than simply reactive.
Reactive user details are collected via:
QUESTION
While trying to dockerise an r-shiny app I am having problems with Docker cache invalidation. Changing a file in /app
seems to invaildate cache only on docker-compose build
output, this doesn't reflect inside the container where files are not changed at all. Below the output of the build command:
ANSWER
Answered 2019-Oct-20 at 14:01From your build output, as you've observed, the cache is indeed invalidated and you build a new image with the new contents of your directory. However, from the comments, you then run this container with a volume /app:/srv/shiny-server
which will map access to this directory inside the container in /srv/shiny-server
to the host at /app
. Note that this path is an absolute path, rather than a relative path, so the files are on the host at /app
rather than in your build directory in ./app
.
Depending on your use case, there are various solutions. First, in the compose file, you have access to relative paths, so if you are testing locally (the typical reason to mount a volume), then you often want to mount the volume with a relative path like ./app:/srv/shiny-server
. The result is the container runs with the contents of this directory without needing to rebuild the image, which is often preferred for faster development cycles.
If you do not want the volume mount, e.g. if this is in production and there's no need to access the files from outside of the container, then removing the volume mount from the compose file is preferred.
And lastly, if you need to have external access to these files, but you want them to be updated by the contents of your image, then you typically want to save the contents of the volume somewhere safe and update the volume with an entrypoint script. In my docker-base repo, I do this with the save-volume
and load-volume
scripts, one to run during the image build, and the other for during the entrypoint when running the container.
QUESTION
I want to render an URL after login into login page in shinyApp. Do not know how to code it.
I have tried with uiOutput() and renderUI(). But does not work. Here is the below code:
...ANSWER
Answered 2019-Aug-27 at 10:47Using extendShinyjs()
QUESTION
I am developing a shiny dashboard. I need to get the user name alone from the login module. I am using callModule() for performing the authentication of the dashboard.
The ui.R code looks like this:
...ANSWER
Answered 2019-Mar-07 at 06:56You can easily manipulate the data you want to display: Here are several:
user_data
only gives you back username
user_data <- reactive({credentials()$info[1]})
Because credentials()$info
is just an array of characters, you can select only the first one: user name
renderTable
only shows user name: You can do:output$user_table <- renderTable({ req(credentials()$user_auth) user_data()[1] })
or
output$user_table <- renderTable({
# use req to only render results when credentials()$user_auth is TRUE
req(credentials()$user_auth)
userData <-user_data()
userData[1]
})
Just by the same logic as the first one: at the end, user_data
it is only some character you want to filter
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shinyauthr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page