OAuth API¶
OAuth flows for connecting third-party services (GitHub, GCP, etc.) to sandboxes.
Authorization Code Flow¶
Start Authorization¶
Redirects the user to the OAuth provider's authorization page.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
redirect_uri | string | Override callback URL |
Supported Providers: Configured in oauth.providers in config.toml. Common providers: github, gcp, azure.
Handle Callback¶
OAuth callback endpoint. Exchanges the authorization code for tokens and stores them as a credential.
Device Code Flow¶
For environments without a browser (e.g., SSH sessions).
Get Device Code¶
Response: 200 OK
{
"device_code": "abc123",
"user_code": "ABCD-1234",
"verification_uri": "https://github.com/login/device",
"expires_in": 900,
"interval": 5
}
Display the user_code and verification_uri to the user.
Poll for Completion¶
Request Body:
Response: 200 OK when authorized, 202 Accepted while pending.
Refresh Token¶
Request Body:
Refreshes the OAuth token for the specified credential.
Response: 200 OK