Initiates an OAuth2 Authorization Code flow with PKCE to authenticate with the Brightspace Data Hub API. The resulting token is cached to disk for reuse across sessions and automatically refreshed when expired.
Usage
bs_auth(
client_id = "",
client_secret = "",
instance_url = "",
redirect_uri = "",
scope = ""
)Arguments
- client_id
OAuth2 client ID. Resolved in order: this argument,
config.yml(if present),BRIGHTSPACE_CLIENT_IDenv var.- client_secret
OAuth2 client secret. Resolved in order: this argument,
config.yml(if present),BRIGHTSPACE_CLIENT_SECRETenv var.- instance_url
Your Brightspace instance URL (e.g.,
"https://myschool.brightspace.com"). Resolved in order: this argument,config.yml(if present),BRIGHTSPACE_INSTANCE_URLenv var.- redirect_uri
The registered redirect URI. Must match the URI registered in your Brightspace OAuth2 app exactly. Supports both
http://localhost(automatic capture via local server) andhttps://localhost(browser-based with URL paste).- scope
OAuth2 scope string (space-separated). Resolved from config.yml or defaults to BDS + ADS scopes.