My organization currently uses the basic subscription to R Shiny. Right now, I'm trying to set up one of our dashboards so that it can perform one of the following functionalities:
Enable login (We've already been able to accomplish this with shinymanager).
Upon successful login, save the name of the inputted user for the rest of that session.
This second step is where I'm stuck. If anybody has ever managed to accomplish this, please let me know. Our current login setup looks something like this:
(Outside of either ui or server):
credentials <- data.frame(
user = ("sample_user", "sample_user_1"),
password = ("password1", "password2"),
admin = (TRUE, FALSE)
)
And within our server object we have this:
res_auth <- secure_server(
check_credentials = check_credentials(credentials)
)
output$auth_output <- renderPrint({
reactiveValuesToList(credentials)
})
However, whenever I try to get some info about the session with session$user
or session$userData
, it is NULL.
I found the solution. After the user is logged in, information about the session can be be found with
auth_output()
, and specifically user information withauth_output()$user
.