Skip to content

Commit

Permalink
deactive keyring to troubleshoot geoflow-shiny in shinyproxy cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Feb 6, 2025
1 parent c862aa2 commit 358de3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion assets/auth_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ initAuthSessionVariables <- function(session, auth_info){
INFO(sprintf("Auth USER: %s", session$userData$GEOFLOW_SHINY_AUTH_USER))
if(!is.null(auth_info$backend) && !is.null(auth_info$service)){
session$userData$GEOFLOW_SHINY_AUTH_PWD = auth_info$backend$get(service = auth_info$service, username = auth_info$user)
INFO(sprintf("Auth PASSWORD: %s", session$userData$GEOFLOW_SHINY_AUTH_PWD))
}else{
session$userData$GEOFLOW_SHINY_AUTH_PWD = auth_info$password
}
if(!is.na(auth_info$token)) session$userData$GEOFLOW_SHINY_AUTH_TOKEN = auth_info$token
}
Expand Down
22 changes: 12 additions & 10 deletions modules/auth_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ authLoginServer <- function (id, config, log_out = shiny::reactiveVal(), reload_

shiny::moduleServer(id, function(input, output, session) {

keyring_backend_name <- if(!is.null(config$auth_keyring_backend)) config$auth_keyring_backend else 'env'
keyring_backend <- keyring:::known_backends[[keyring_backend_name]]$new()
# keyring_backend_name <- if(!is.null(config$auth_keyring_backend)) config$auth_keyring_backend else 'env'
# keyring_backend <- keyring:::known_backends[[keyring_backend_name]]$new()

credentials <- shiny::reactiveValues(
user_auth = FALSE,
user_info = NULL
Expand Down Expand Up @@ -41,24 +41,26 @@ authLoginServer <- function (id, config, log_out = shiny::reactiveVal(), reload_
INFO(sprintf("Using user '%s' root directory", input$auth_username))
appConfig$data_dir_remote <<- paste0(input$auth_username, "/", appConfig$data_dir_remote)
}
keyring_service <- paste0("geoflow-shiny@", auth_endpoint$auth_url)
keyring_backend$set_with_value(keyring_service, username = input$auth_username, password = input$auth_password)

# keyring_service <- paste0("geoflow-shiny@", auth_endpoint$auth_url)
# keyring_backend$set_with_value(keyring_service, username = input$auth_username, password = input$auth_password)
#
credentials$user_auth <- TRUE
credentials$auth_info <- list(
endpoint = auth_endpoint,
backend = keyring_backend,
service = keyring_service,
# backend = keyring_backend,
# service = keyring_service,
user = input$auth_username,
password = input$auth_password,
token = NA
)
}else{
credentials$user_auth <- FALSE
credentials$auth_info <- list(
endpoint = character(0),
backend = character(0),
service = character(0),
# backend = character(0),
# service = character(0),
user = character(0),
password = character(0),
token = character(0)
)
}
Expand Down

0 comments on commit 358de3c

Please sign in to comment.