Cast AI O Auth Apps API
OAuthAppsAPI manages organization-scoped OAuth 2.0 application registrations and the per-user authorization code login flow against them. An admin registers an OAuth app (client credentials, provider endpoints, scopes and the host patterns the issued tokens apply to). Any member of the organization can then log in: StartOAuthLogin builds the provider authorize URL, the frontend drives the browser through the provider's consent flow, and CompleteOAuthLogin exchanges the returned code for tokens. Issued per-user tokens are stored via the secrets domain and resolve through it (phantom-token pattern), refreshing on read when near expiry. Credential material (client secrets, user tokens) is write-only over this API and is never returned in responses.