Skip to main content

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

  1. Call this API to obtain the third-party login URL.
  2. Redirect the user to the returned URI.
  3. After the user finishes third-party authorization, they are redirected back to the specified redirect_uri.
  4. 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

A successful response.

Response Headers
    Schema
      uri Callback URL (string)
    Loading...