TokensApi: Agave Token API operations

Description Usage Format Details Arguments Methods See Also

Description

TokensApi Class

OAuth2 token api client to manage credentials and session caching.

Note: This class is NOT generated by the swagger code generator program.

Usage

1
tokens <- TokenApi$new(apiClient, cache, client, username, password, responseType="list")

Format

An object of class R6ClassGenerator of length 24.

Details

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
api <- Agave$new(username="username", password="password"
                 clientKey="abcde", clientSecret="12345")

myClient <- api$clients$create(clientName = "my_client")

myToken = api$tokens$create(client=myClient)

api$reload(client=myClient, token=myToken)

Arguments

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:

Methods

$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()

See Also

rAgave::Token rAgave::ClientsApi rAgave::Client


agaveplatform/r-sdk documentation built on Sept. 22, 2018, 2:14 p.m.