tencent cloud

Tencent OneID Identity Security

Get User Information

Download
Focus Mode
Font Size
Last updated: 2026-08-26 15:38:13
AI-Translated

API Description

Obtain the user information of the logged-in user. When this API is called, the Access Token obtained upon successful login and containing the openid scope must be included.

Supported Application Types

Web applications, single-page applications, mobile apps, and M2M applications.

Request Method

GET

Request path

/userinfo

Request Example

GET /userinfo HTTP/1.1
Authorization: Bearer ACCESS_TOKEN_WITH_OPENID_SCOPE
Host: sample.portal.tencentciam.com

Request header

Term
Description
Authorization
The OAuth 2.0 Bearer Token has the format Bearer <Token>. Here, Bearer is a fixed string, and <Token> is the Access Token obtained upon successful user login, which contains the openid scope. A single space separates Bearer and <Token>.

Normal Response Example

HTTP/1.1 200 OK
Content-Type: application/json

{
"sub" : "MOCK_USER_ID",
"email" : "MOCK_USERNAME@example.com",
"name" : "MOCK_NAME",
"nickname" : "MOCK_NICKNAME",
"zoneinfo" : "Asia/Shanghai",
"locale" : "zh-CN"
}

Response Parameters

Parameter
Data Type
Description
sub
String
The user identifier is unique within the user pool.
Note:
The sub field is always returned. Which other fields are returned is determined by the Claims in the application parameter configuration.

Exception Response Example

The Access Token is not included.
HTTP/1.1 400 Bad Request
WWW-Authenticate: Bearer error="invalid_request", error_description="Bearer token not found in the request", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The Access Token is invalid (for example, due to incorrect format, expiration, or revocation).
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="Error decoding JWT", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The Access Token does not contain the openid scope.
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token.", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The user corresponding to the Access Token cannot be found.
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8

{
"error" : "user_not_found"
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback