Skip to main content

OAuth Authentication

The UCSDClient authenticates with the UCSD Metadata API using OAuth 2.0 bearer tokens.

Token Acquisition​

The GetToken() method:

  1. Sends a token request to the configured auth URL
  2. Provides username and password from MetadataApiOptions
  3. Receives a bearer token
  4. Includes the token in subsequent API requests as an Authorization: Bearer header

Configuration​

Token acquisition is configured via MetadataApiOptions:

SettingDescription
AuthUrlOAuth token endpoint URL
BaseUrlUCSD Metadata API base URL
TestUrlTest device endpoint URL
UsernameOAuth username
PasswordOAuth password (Key Vault reference)

Token Lifecycle​

  • Tokens are acquired per request or cached for their validity period
  • If a token expires mid-operation, a new token is requested automatically
  • All credentials are stored in Azure App Configuration with Key Vault references β€” never in source code