View source: R/ArmadilloOAuth.R
armadillo.get_credentials | R Documentation |
Get credentials information
armadillo.get_credentials(server)
server |
the URL of the Armadillo server |
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.
The credentials
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.