Skip to main content

Get Current User Information

GET 

/auth/v1/user/me

API Description

Get the current logged-in user's basic information, including user profile, bound identity sources, role permissions, etc.

Input Requirements:

  • Authorization: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
  • client_id: Client ID corresponding to the application (optional, defaults to environment ID)
  • x-device-id: Device ID (optional, current logged-in device ID)

Prerequisites:

  • Need valid access_token
  • User must be logged in

Output:

  • Returns complete user information object (v1Profile)
  • Includes user basic information, bound identity sources, role permissions, status, etc.

Get User Information Request Example

GET /auth/v1/user/me
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ
x-device-id: device_123456

Get User Information Response Example

{
"sub": "9876543210123456789",
"name": "Zhang San",
"picture": "https://example/avatar.jpg",
"username": "zhangsan",
"email": "zhangsan@example",
"phone_number": "+86 13000000000",
"providers": [
{
"id": "email",
"provider_user_id": "zhangsan@example",
"name": "Email Login",
"picture": "",
"url": "",
"meta": {}
}
],
"status": "ACTIVE",
"gender": "MALE",
"groups": [
{
"id": "user"
}
],
"meta": {
"department": "Technology Department",
"position": "Development Engineer"
},
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-15T10:30:00Z",
"password_updated_at": "2023-01-01T00:00:00Z",
"user_id": "9876543210123456789",
"has_password": true,
"internal_user_type": "generalUser",
"type": "external",
"user_source": 1,
"user_desc": "Regular User",
"last_login": "2023-01-15T10:30:00Z"
}

Usage Scenarios:

  • Get personal information after user login
  • Display user profile page
  • Check user permissions and roles
  • Get user's bound login methods

Key Characteristics:

  • Returns complete user information, including sensitive information (email, phone number, etc.)
  • Includes all identity sources bound to user
  • Shows user status and role permissions
  • Provides user extended information (meta field)

Request

Query Parameters

    client_id string

    Client ID corresponding to the application, can be obtained from Cloud Development Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted

Header Parameters

    x-device-id string

    Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.

    Authorization stringrequired

    The access_token of the current logged-in user, format is Bearer xxx

    Example: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ

Body

    any

Responses

A successful response.

Response Headers
    Schema
      sub string

      User subject

      name string

      User nickname

      picture string

      User avatar

      username string

      Username

      email string

      Email

      phone_number string

      Phone number

      providers object[]

      Linked login methods

    • Array [
    • id string

      Identity provider ID

      provider_user_id string

      Provider user ID

      name string

      Identity provider name

      picture string

      Identity provider avatar

      url string

      Identity provider URL

      meta object

      Identity provider metadata

      property name* string
    • ]
    • status ProfileProfileStatus (string)

      Possible values: [DEFAULT, ACTIVE, PENDING, BLOCKED]

      User status

      gender string

      Gender

      groups object[]

      User groups, list of role identifiers bound to the user

    • Array [
    • id string

      Role identifier

    • ]
    • meta object

      User metadata

      property name* string
      created_at date-time

      Creation time

      updated_at date-time

      Update time

      password_updated_at date-time

      Password update time

      user_id string

      Micro-app user ID

      has_password boolean

      Indicates if a password is set

      internal_user_type string

      Internal user type: built-in super admin (administrator), general user (generalUser)

      type string

      User type: internal, external

      user_source int32

      User source: 1-self-built, 2-WeCom enterprise, 3-external registration

      user_desc string

      User description

      open_id string

      WeChat or WeCom openID

      corp_id string

      Corporation ID

      parent_user_id string

      Direct supervisor ID

      main_dep string

      Main department ID

      sort int32

      Sort value; lower sort means higher priority

      last_login date-time

      Last login time

    Loading...