tencent cloud

Customer Identity and Access Management

Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Operation Guide
User pool management
User management
Application management
Authentication management
Audit management
Custom settings
Development Guide
Overview
Access via Authentication API
Get User Information
Update User Information
Modify User Password
Reset User Password
Get Token
Get JWT Public Key
Refresh Token
Revoke Token
Get OpenID Provider Configuration
API Documentation
History
Introduction
API Category
Making API Requests
User Management APIs
Data Sync APIs
Audit Management APIs
Data Types
Error Codes
FAQs
Features
Billing
CIAM Policy
Privacy Policy
Data Processing And Security Agreement

Get User Information

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2023-12-22 11:42:07

API Description

This API is used to get the user information of a logged-in user. When calling this API, you need to carry the Access Token with openid scope returned when the login is successful.

Supported Applications

Web applications, single-page applications (SPA), mobile applications, and machine-to-machine (M2M) applications.

Request Method

GET

Request Path

/userinfo

Sample Requests

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

Request Headers

Parameter
Description
Authorization
OAuth 2.0 Bearer Token. The format is Bearer <Token>, where Bearer is a fixed string and <Token> is the Access Token with openid scope returned when the login is successful. Bearer and <Token> are separated by a space.

Sample Success Responses

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
Unique identifier of the user in the user pool.
Note:
Only the sub parameter must be returned, and other parameters returned are determined by Claims in the application parameter configuration.

Sample Error Responses

No Access Token.
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, the Token format is invalid. The Token has expired or has been revoked.
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 contain 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"
No user found for the Access Token.
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8

{
"error" : "user_not_found"
}


도움말 및 지원

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

피드백