Get Third-Party Login Callback URL
GET/auth/v1/provider/uri
API Description
Get the callback URL for third-party identity provider login, used in the OAuth authorization flow.
Input Requirements
provider_id: Identity provider ID (required, e.g., github, wechat)redirect_uri: Redirect URL (optional)state: Client state parameter (optional, used to prevent CSRF attacks)scope: Authorization scope (optional)response_type: Authorization type (optional)client_id: Client ID (optional, defaults to environment ID)x-device-id: Device ID (required, passed in the request header)
Output
- Returns the callback URI for third-party login.
Request Example
GET /auth/v1/provider/uri?provider_id=github&state=random_state_string
x-device-id: device_123456
Response Example
{
"uri": "https://github.com/login/oauth/authorize?client_id=your_client_id&redirect_uri=https://your-app.com/callback&state=random_state_string&scope=user"
}
Usage Flow
- Call this API to obtain the third-party login URL.
- Redirect the user to the returned URI.
- After the user finishes third-party authorization, they are redirected back to the specified
redirect_uri. - Retrieve the authorization code from the callback for subsequent token retrieval.
Request
Responses
- 200
- 500
A successful response.
Response Headers
An unexpected error response.