TheiaAuth | R Documentation |
Generate and manage authentication to Theia website from login and password. It requests a token to download tiles when created and automatically request a new one when it has expired (after 2h). It is used to download tiles from TheiaTile and TheiaCollection objects.
a <- TheiaAuth$new(auth.file) a$token()
A TheiaAuth
object
The path to the file containing login and password. It will be created if it does not exist. See 'Details' for more informations
TheiaAuth$new(auth.file)
Create a new instance of the class
a$token()
Return the current token or generate a next one if it has
expired
This class is used to manage authentication to Theia website, without intervention from the user. Login and password must be stored in a separate text file with these two lines:
login password
File content is read each time authentication is needed (to request a new token), so login and password are not stored in R's memory. If this file does not exist, R will prompt you to enter your login and password and will create the file.
## Not run: # create an authentication object myauth <- TheiaAuth$new("path_to_auth_file.txt") # show the access token (and request a new one if needed) myauth$token ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.