Obtain Third-party Authorization Information
POST/auth/v1/provider/token
Obtain authorization information for third-party services, such as via OAuth login, acquire authorized user information corresponding to the OAuth client to generate a provider_token, which is required for invoking the identity source login interface.
Request
Query Parameters
client_id string
The client ID corresponding to the application, which defaults to the environment ID and can be omitted
Header Parameters
x-device-id stringrequired
Device ID
- application/json
Body
provider_id Identity source ID, such as wx_open or Mini Program app ID (string)required
provider_redirect_uri Identity source callback address (string)
provider_code Login code obtained from a third-party system, used to exchange for user identity (string)
Responses
- 200
- 500
A successful response.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
provider_token If auto-registration is not enabled, returns provider_token for further processing, e.g., via mobile number (string)
expires_in int32
provider_profile object
provider_id Identity source ID (string)
sub Primary ID, identifying unique user identifier (string)
name Full name (string)
picture Avatar (string)
email Email (string)
phone_number Mobile number (string)
gender Gender (string)
locale Region (string)
url URL (string)
groups string[]
sub_id sub_id If SLO is required, sub_id may need to be returned. Reference: urn:oasis:names:tc:SAML:attribute:subject-id (string)
token Token returned by provider, e.g., refresh_token in OAuth mode (string)
at_hash at hash of provider profile (string)
meta object
object
property name* string
raw Raw information from third party (string)
provider Identity source type (string)
{
"provider_token": "string",
"expires_in": 0,
"provider_profile": {
"provider_id": "string",
"sub": "string",
"name": "string",
"picture": "string",
"email": "string",
"phone_number": "string",
"gender": "string",
"locale": "string",
"url": "string",
"groups": [
"string"
],
"sub_id": "string",
"token": "string",
"at_hash": "string",
"meta": {},
"raw": "string",
"provider": "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...