foundry_set_token_provider: Set a Microsoft Entra ID token provider

View source: R/auth.R

foundry_set_token_providerR Documentation

Set a Microsoft Entra ID token provider

Description

Register a function that returns a Microsoft Entra ID bearer token when foundryR needs to authenticate without an API key. This is useful for long polling jobs and keyless production environments where tokens should be refreshed automatically.

Usage

foundry_set_token_provider(provider, scope = c("resource", "project"))

Arguments

provider

Function or NULL. A zero-argument function that returns a bearer token string. Use NULL to clear the provider.

scope

Character. Endpoint family that the provider authenticates: "resource" or "project".

Value

Invisibly returns the previous provider.

Examples

local({
  old <- foundry_set_token_provider(foundry_token_azure_cli())
  on.exit(foundry_set_token_provider(old))
})

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.