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
Query Parameters
provider_id stringrequired
Identity provider ID
Example: github
redirect_uri string
Redirect URL
state string
Current state of the client, any value can be specified
scope string
Authorization scope
response_type string
Authorization type
client_id string
Client ID corresponding to the application, defaults to environment ID, can be omitted
Header Parameters
x-device-id stringrequired
Device ID
Responses
- 200
- 500
A successful response.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
uri Callback URL (string)
{
"uri": "string"
}
An unexpected error response.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
error Error message (string)
error_code int32
error_description Error description (string)
{
"error": "string",
"error_code": 0,
"error_description": "string"
}
Loading...