CreateSaslUser

更新时间: 2026-05-15 19:28:39

Creates a Simple Authentication and Security Layer (SASL) user.

Debugging

You can call this operation in OpenAPI Explorer to simplify debugging. After a successful call, OpenAPI Explorer automatically calculates signatures and generates sample SDK code.

Authorization

The following table describes the authorization information for this operation. You can add this information to the Action element of a RAM policy to grant a RAM user or RAM role permission to call this operation.

  • Operation: The specific API operation.

  • Access level: The access level of the operation. Valid values: Write, Read, and List.

  • Resource type: The resource type that the operation supports. The following items describe how this field is displayed:

    • Required resource types are highlighted.

    • If an operation does not support resource-level authorization, this field displays All resources.

  • Condition key: The condition keys defined by the cloud service.

  • Associated operation: Other operations that you must have permission to call for this operation to succeed.

Actions

Access level

Resource type

Condition key

Associated operation

alikafka:CreateSaslUser

Write

instance

acs:alikafka:{#regionId}:{#accountId}:instance/{#InstanceId}

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region.

cn-hangzhou

InstanceId

string

Yes

The ID of the instance.

alikafka_pre-cn-v0h1cng0****

Username

string

Yes

The SASL username.

test***

Password

string

Yes

The password for the SASL user.

12***

Type

string

No

The authentication method. Valid values:

  • plain: a simple username and password authentication mechanism. ApsaraMQ for Kafka enhances the PLAIN mechanism to allow you to dynamically add SASL users without the need to restart the instance.

  • scram: a username and password authentication mechanism that is more secure than PLAIN. ApsaraMQ for Kafka uses SCRAM-SHA-256.

  • LDAP: This value is available only for ApsaraMQ for Confluent instances.

Default value: plain.

plain

Mechanism

string

No

The encryption method. Valid values:

  • SCRAM-SHA-512 (default)

  • SCRAM-SHA-256

Note

This parameter is supported only on serverless instances.

SCRAM-SHA-256

Response parameters

Parameter

Type

Description

Example

object

The response object.

Code

integer

The response code. A value of 200 indicates that the request was successful.

200

Message

string

The message returned.

operation success.

RequestId

string

The ID of the request.

C5CA600C-7D5A-45B5-B6DB-44FAC2C****

Success

boolean

Indicates whether the operation was successful.

true

Examples

Example of a successful response

JSON format

{
  "Code": 200,
  "Message": "operation success.",
  "RequestId": "C5CA600C-7D5A-45B5-B6DB-44FAC2C****",
  "Success": true
}

Error codes

For a list of error codes, see Common error codes.

Change history

Date

Description

Actions

2024-04-02

Updated the OpenAPI error codes and input parameters.

View change details

上一篇: SASL users 下一篇: DeleteSaslUser - Delete a SASL user
阿里云首页 云消息队列 Kafka 版 相关技术圈