Get credentials information

armadillo.get_credentials(server)

Arguments

server

the URL of the Armadillo server

Value

The credentials

Details

This function fetched various details from the auth server, including refresh, id and access tokens. NOTE: in order to get refresh token, refresh tokens should be turned on for this armadillo instance on the auth server. When access tokens are fetched using this method, it enables the automatic refreshing of tokens when they time out. This works by checking whether the current token(s) have expired, and if so attempting to refresh them and write the refreshed token to the connection and credentials objects in the global environment. For this to work correctly, ensure that there only exists one DataSHIELD connections object in the global environment, and that for each datasource there is only object containing their credentials.

Examples

if (FALSE) { # \dontrun{
example_url <- "https://armadillo.example.org"
credentials <- armadillo.get_credentials(example_url)

builder <- newDSLoginBuilder()
builder$append(
  url = example_url,
  server = "example_server",
  token = credentials@access_token,
  driver = "ArmadilloDriver")
logindata <- builder$build()

conns <- datashield.login(logins = logindata, assign = FALSE)
} # }