User management API

IAM IAM

  • API Reference
    • Common request header and common response header
    • Data type
    • Error code
    • Feature Update Records
    • General Description
    • Introduction
    • Service domain
    • STS-Related Interfaces
  • API Reference_IAM
    • Common request header and common response header
    • Data type
    • Error code
    • General Description
    • Group management API
    • Introduction
    • Policy management API
    • Role Management Interfaces
    • Service domain
    • User management API
  • FAQs
    • Common Questions Overview
    • FAQs related to IAM users
    • FAQs related to product permissions
  • Function Release Records
  • Operation guide
    • Account Security Audit
    • Enterprise Account Integration
      • Federated Login Overview
      • IAM Role-based SSO
      • IAM User-based SSO
    • Group Management
    • Message Center
    • Permission Policies
      • ACL
      • Authorization
      • Managing IAM Policies
      • Permission Policy Overview
      • Policy Authentication Evaluation Logic
      • Strategy type
      • Tag-Based Authorization and Authentication
    • Role Management
      • Common scenarios
      • Create role
      • FAQs
      • Managing Roles
      • Overview
      • Related concepts
      • Using Roles
    • Settings
    • User
      • IAM User Operations
      • Two-Factor Authentication
      • User management
    • User Anomaly Behavior Analysis (Public Beta)
      • Risk Behavior Management
  • Operation records
    • Cloud Trail (Public Beta)
  • Product Announcement
    • Baidu Intelligent Cloud Enables Login Protection MFA Multi-Factor Authentication Notification for All Users
  • Product Description
    • Application scenarios
    • Concepts
    • Currently Supported Product Lines
    • Product functions
    • Product overview
    • System Restrictions
    • Enterprise Organization vs Identity and Access Management
  • Product pricing
    • Product pricing
  • Quick Start
    • Create groups and grant permissions
    • Creating IAM User Administrators
  • SDK
    • Go-SDK
      • Error handling
      • Group management API
      • Initialize SDK
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Java-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Python-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
  • Testing Knowledge Base SDK
  • Typical Practices
    • Baidu Intelligent Cloud Partner Guide to Creating IAM Users
    • User Management and Permission Assignment
All documents
menu
No results found, please re-enter

IAM IAM

  • API Reference
    • Common request header and common response header
    • Data type
    • Error code
    • Feature Update Records
    • General Description
    • Introduction
    • Service domain
    • STS-Related Interfaces
  • API Reference_IAM
    • Common request header and common response header
    • Data type
    • Error code
    • General Description
    • Group management API
    • Introduction
    • Policy management API
    • Role Management Interfaces
    • Service domain
    • User management API
  • FAQs
    • Common Questions Overview
    • FAQs related to IAM users
    • FAQs related to product permissions
  • Function Release Records
  • Operation guide
    • Account Security Audit
    • Enterprise Account Integration
      • Federated Login Overview
      • IAM Role-based SSO
      • IAM User-based SSO
    • Group Management
    • Message Center
    • Permission Policies
      • ACL
      • Authorization
      • Managing IAM Policies
      • Permission Policy Overview
      • Policy Authentication Evaluation Logic
      • Strategy type
      • Tag-Based Authorization and Authentication
    • Role Management
      • Common scenarios
      • Create role
      • FAQs
      • Managing Roles
      • Overview
      • Related concepts
      • Using Roles
    • Settings
    • User
      • IAM User Operations
      • Two-Factor Authentication
      • User management
    • User Anomaly Behavior Analysis (Public Beta)
      • Risk Behavior Management
  • Operation records
    • Cloud Trail (Public Beta)
  • Product Announcement
    • Baidu Intelligent Cloud Enables Login Protection MFA Multi-Factor Authentication Notification for All Users
  • Product Description
    • Application scenarios
    • Concepts
    • Currently Supported Product Lines
    • Product functions
    • Product overview
    • System Restrictions
    • Enterprise Organization vs Identity and Access Management
  • Product pricing
    • Product pricing
  • Quick Start
    • Create groups and grant permissions
    • Creating IAM User Administrators
  • SDK
    • Go-SDK
      • Error handling
      • Group management API
      • Initialize SDK
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Java-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Python-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
  • Testing Knowledge Base SDK
  • Typical Practices
    • Baidu Intelligent Cloud Partner Guide to Creating IAM Users
    • User Management and Permission Assignment
  • Document center
  • arrow
  • IAMIAM
  • arrow
  • SDK
  • arrow
  • Java-SDK
  • arrow
  • User management API
Table of contents on this page
  • Create User
  • Query user
  • Update user
  • Delete user
  • List users
  • Configure console login for the user
  • Query console login configuration
  • Disable console login configuration
  • Create user's AccessKey
  • Disable user's AccessKey
  • Enable user's AccessKey
  • Delete user's AccessKey
  • List user's AccessKeys

User management API

Updated at:2025-10-27

Create User

Support creating IAM users. Please refer to the following codes:

Java
1public void createUser(IamClient client) {
2    CreateUserRequest createUserRequest = new CreateUserRequest();
3 //Set the username, with a length of 1-64 characters and consisting of letters, numbers, or "_"
4    createUserRequest.setName("test_user_name");
5 // Set user description
6    createUserRequest.setDescription("test_user_description");
7    
8    client.createUser(createUserRequest);
9}

Query user

Query an IAM user with reference to the following codes:

Java
1public void getUser(IamClient client) {
2 // Set username
3    String userName = "test_user_name";
4    
5    client.getUser(userName);
6}

Update user

Support creating IAM users. Please refer to the following codes:

Java
1public void updateUser(IamClient client) {
2 // Current username
3    String userName = "test_user_name";
4 // Set updated user information
5    UpdateUserRequest updateUserRequest = new UpdateUserRequest();
6 // Set updated username
7    updateUserRequest.setName("new_user_name");
8 // Set updated user description
9    updateUserRequest.setDescription("new_user_description");
10    
11    client.updateUser(userName, updateUserRequest);
12}

Delete user

Support deleting an IAM user with reference to the following codes:

Java
1public void deleteUser(IamClient client) {
2 // Current username
3    String userName = "test_user_name";
4    
5    client.deleteUser(userName);
6}

List users

List users with reference to the following codes:

Java
1public void listUser(IamClient client) {
2    client.listUser();
3}

Configure console login for the user

Configure console login for the user with reference to the following codes:

Java
1public void updateLoginProfile(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    UpdateLoginProfileRequest updateLoginProfileRequest = new UpdateLoginProfileRequest();
5 // Set user password; not displayed in responses
6    updateLoginProfileRequest.setPassword("new_passwd");
7 // Whether to reset the password at next login
8    updateLoginProfileRequest.setNeedResetPassword(true);
9 // Whether binding a secondary verification device is required
10    updateLoginProfileRequest.setEnabledLoginMfa(true);
11 // Secondary verification type, options: PHONE-mobile phone number, TOTP MFA Device
12    updateLoginProfileRequest.setLoginMfaType("PHONE");
13 // Bound third-party login types, options: UUAP-intranet account, PASSPORT-Baidu account
14    updateLoginProfileRequest.setThirdPartyType("UUAP");
15 // Bound third-party login account. When the binding type is PASSPORT, it can be a mobile phone number, email, or account name
16    updateLoginProfileRequest.setThirdPartyAccount("PASSPORT");
17    client.updateLoginProfile(userName,updateLoginProfileRequest)
18}

Note: 1. Unbinding is performed when thirdPartyType and thirdPartyAccount are both empty strings; 2. If enabledLoginMfa":true is set, loginMfaType must be specified

Query console login configuration

Query console login configuration for the user with reference to the following codes:

Java
1public void getLoginProfile(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    client.getLoginProfile(userName);
5}

Disable console login configuration

Disable user's console login configuration, i.e., disable user's console login, with reference to the following codes:

Java
1public void deleteLoginProfile(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    client.deleteLoginProfile(userName);
5}

Create user's AccessKey

Create a set of AccessKeys for the user with reference to the following codes:

Java
1public void createAccessKey(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    
5    client.createAccessKey(userName);
6}

Disable user's AccessKey

Disable a specified set of AccessKeys for the user with reference to the following codes:

Java
1public void disableAccessKey(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    // ak
5    String accessKeyId = "test_user_ak";
6    
7    client.disableAccessKey(userName, accessKeyId);
8}

Enable user's AccessKey

Recover a specified set of AccessKeys for the user to "Enabled" status with reference to the following codes:

Java
1public void enableAccessKey(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    // ak
5    String accessKeyId = "test_user_ak";
6    
7    client.enableAccessKey(userName, accessKeyId);
8}

Delete user's AccessKey

Delete a specified set of AccessKeys for the user with reference to the following codes:

Java
1public void deleteAccessKey(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    // ak
5    String accessKeyId = "test_user_ak";
6    
7    client.deleteAccessKey(userName, accessKeyId);
8}

List user's AccessKeys

List all AccessKeys for the user with reference to the following codes:

Java
1public void listAccessKey(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    
5    client.listAccessKey(userName);
6}

Previous
Role Management Interfaces
Next
Version Change Records