Description Usage Format Details Arguments Methods See Also
TokensApi Class
OAuth2 token api client to manage credentials and session caching.
Note: This class is NOT generated by the swagger code generator program.
1 | tokens <- TokenApi$new(apiClient, cache, client, username, password, responseType="list")
|
An object of class R6ClassGenerator
of length 24.
The Tokens API is an OAuth2 endpoint handling all authentication and token management for the Agave Platform.
In order to fetch an access token, you must have a valid, registered rAgave::Client > application. Please see the rAgave::ClientsApi documentation for more on creating and > managing client keys.
1 2 3 4 5 6 7 8 |
apiClient
a rAgave::ApiClient instance preconfigured to speak to the Agave Platform.
cache
an rAgave::AgaveCache instance pointing to the persistent auth cache file on disk.
client
a rAgave::Client instance with valid key and secret for the tenant pointed
to by apiClient
.
username
the username that will be used to authenticate the user and obtain an access token.
password
the password that will be used to authenticate the user and obtain an access token.
responseType
the default object type methods of this class should return. Valid values are:
raw: the raw JSON string response from the API. You may optionally include
pretty=TRUE
in the method call to receive pretty printed JSON.
list: a standard R list object. This is the default value.
dt: a data table
$impersonate(tokenUsername)
fetches a token for another user. To use this
method, you must have the "impersonator" role.
Usage
1 2 | tokens$impersonate(tokenUsername="testuser")
tokens$impersonate(tokenUsername="testuser", username="username", password="password")
|
$create(updateCache, client, username, password)
fetch a new token.
Usage
1 2 | tokens$create()
tokens$create(updateCache=TRUE,username=myUsername, password=myPassword, client=myClient)
|
$refresh(updateCache, client, refreshToken)
refresh the current token using the
refreshToken cached on disk or provided to the method.
Usage
1 2 | tokens$refresh()
tokens$refresh(refreshToken=myRefreshToken, client=myClient)
|
'$revoke(updateCache, client, accessToken)“ revoke the given access token or invalidate the one cached on disk.
Usage
1 2 | tokens$revoke()
tokens$revoke(accessToken="zyxwvut")
|
$loadFromSystemConfiguration()
Read the local auth cache file and, if a token
is found, load and use that.
Usage
1 | tokens$loadFromSystemConfiguration()
|
rAgave::Token rAgave::ClientsApi rAgave::Client
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.