Method new()
Create a new DefaultCredential object
Usage
DefaultCredential$new(
scope = NULL,
tenant_id = NULL,
client_id = NULL,
client_secret = NULL,
use_cache = "disk",
offline = TRUE,
chain = default_credential_chain()
)
Arguments
scope
Optional character string specifying the authentication scope.
tenant_id
Optional character string specifying the tenant ID for
authentication.
client_id
Optional character string specifying the client ID for
authentication.
client_secret
Optional character string specifying the client secret
for authentication.
use_cache
Character string indicating the caching strategy. Defaults
to "disk". Options include "disk" for disk-based caching or "memory"
for in-memory caching.
offline
Logical. If TRUE, adds 'offline_access' to the scope to request a 'refresh_token'.
Defaults to TRUE.
chain
A list of credential objects, where each element must inherit
from the Credential base class. Credentials are attempted in the order
provided until get_token succeeds.
Returns
A new DefaultCredential object
Method get_token()
Get an access token using the credential chain
Usage
DefaultCredential$get_token()
Returns
An httr2::oauth_token() object containing the access token
Method req_auth()
Add authentication to an httr2 request
Usage
DefaultCredential$req_auth(req)
Arguments
req
An httr2::request() object
Returns
The request object with authentication configured
Method clone()
The objects of this class are cloneable with this method.
Usage
DefaultCredential$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.