View source: R/default-credential.R
| get_credential_provider | R Documentation |
Discovers and returns an authenticated credential object from a chain of credential providers. This function attempts each credential in the chain until one successfully authenticates, returning the first successful credential object.
get_credential_provider(
scope = NULL,
tenant_id = NULL,
client_id = NULL,
client_secret = NULL,
use_cache = "disk",
offline = TRUE,
oauth_host = NULL,
oauth_endpoint = NULL,
chain = NULL,
interactive = TRUE,
verbose = getOption("azr.verbose", FALSE)
)
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 |
offline |
Logical. If |
oauth_host |
Optional character string specifying the OAuth host URL. |
oauth_endpoint |
Optional character string specifying the OAuth endpoint. |
chain |
A list of credential objects, where each element must inherit
from the |
interactive |
A logical value indicating whether interactive credentials
are allowed. Defaults to |
verbose |
A logical value indicating whether to print verbose messages
during credential discovery. Defaults to |
A credential object that inherits from the Credential class and
has successfully authenticated.
get_token_provider(), get_request_authorizer(),
default_credential_chain()
## Not run:
# Get a credential provider with default settings
cred <- get_credential_provider(
scope = "https://graph.microsoft.com/.default",
tenant_id = "my-tenant-id"
)
# Use the credential to get a token
token <- cred$get_token()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.