Learn R Programming

azr (version 0.2.0)

credential_chain: Create Custom Credential Chain

Description

Creates a custom chain of credential providers to attempt during authentication. Credentials are tried in the order they are provided until one successfully authenticates. This allows you to customize the authentication flow beyond the default credential chain.

Usage

credential_chain(...)

Value

A credential_chain object containing the specified sequence of credential providers.

Arguments

...

Named credential objects or credential classes. Each element should be a credential class (e.g., ClientSecretCredential) or an instantiated credential object that inherits from the Credential base class. The names are used for identification purposes.

See Also

default_credential_chain(), get_token_provider()

Examples

Run this code
# Create a custom chain with only non-interactive credentials
custom_chain <- credential_chain(
  client_secret = ClientSecretCredential,
  azure_cli = AzureCLICredential
)

# Use the custom chain to get a token
if (FALSE) {
token <- get_token(
  scope = "https://graph.microsoft.com/.default",
  chain = custom_chain
)
}

Run the code above in your browser using DataLab