tencent cloud

문서Tencent OneID Identity Security

Get User Information

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-08-26 15:38:13
AI 번역

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"
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백