All Products
Search
Document Center

ApsaraMQ for MQTT:QueryCustomAuthIdentity

Last Updated:Jun 13, 2026

Queries custom identity authentication.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mq:QueryCustomAuthIdentity

get

*Instance

acs:mq:{#regionId}:{#accountId}:{#InstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the ApsaraMQ for MQTT instance.

post-111****

Username

string

No

The username.

test

IdentityType

string

No

The identity type.

USER

ClientId

string

No

The client ID of the device. You can specify this parameter when the identity type is CLIENT.

GID_test@@@test

NextToken

string

No

The token that marks the end position of the current query. You can pass this token as a parameter in the next call to continue paginating. If this is the first call or the last page is returned, the value is an empty string.

eyJhY2NvdW50IjoiMTM4MTcxODk3NDQzMjQ1OSIsImV2ZW50SWQiOiJGMkUxOUE3QS1FM0Q0LTVCOEYtQkU4OS1CNkMyM0RBM0UyRjIiLCJsb2dJZCI6IjY2LTEzODE3MTg5NzQ0MzI0NTkiLCJydyI6IlciLCJ0aW1lIjoxNjc4MzI2MTI1MDAwfQ

Size

integer

Yes

The number of entries to query. Maximum value: 100.

100

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

11568B5B-13A8-4E72-9DBA-3A14F7D3****

Code

integer

The response code. 200: The request is successful. Other codes indicate errors. For more information about error codes, see Error codes.

200

Success

boolean

Indicates whether the request is successful. true: The request is successful. false: The request failed.

True

Message

string

The additional information.

operation success.

Data

object

The query result.

Results

array<object>

The returned data.

object

The returned data.

Username

string

The username.

test

Secret

string

The AccessKey secret.

62a5916d71767185b48907d85c2efa****

IdentityType

string

The identity type. Valid values:

  • USER

  • CLIENT

USER

ClientId

string

The client ID if IdentityType is set to CLIENT.

GID_ICP@@@4d378084

SignMode

string

The signature verification mode. ORIGIN: compares the password and the AccessKey secret. SIGNED: uses the HMAC_SHA1 algorithm to sign the client ID to obtain a password and then compares the password.

SIGNED

NextToken

string

If more results are available, a NextToken is returned.

AAAAAXA+GzVqTutYpgkFjBrchKzuvSbpuTqtt6OF9tsC9QnJ

Examples

Success response

JSON format

{
  "RequestId": "11568B5B-13A8-4E72-9DBA-3A14F7D3****",
  "Code": 200,
  "Success": true,
  "Message": "operation success.",
  "Data": {
    "Results": [
      {
        "Username": "test",
        "Secret": "62a5916d71767185b48907d85c2efa****",
        "IdentityType": "USER",
        "ClientId": "GID_ICP@@@4d378084",
        "SignMode": "SIGNED"
      }
    ],
    "NextToken": "AAAAAXA+GzVqTutYpgkFjBrchKzuvSbpuTqtt6OF9tsC9QnJ"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.%s An error occurred while validating the parameter. The parameter may be missing or invalid.
400 InstancePermissionCheckFailed An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings.
404 ApiNotSupport The specified API is not supported.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.