添加账号身份认证信息,可以具体到客户端。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
mq:AddCustomAuthIdentity |
create |
*Instance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
云消息队列 MQTT 版实例的 ID。 |
mqtt-cn-xxxx |
| Username |
string |
是 |
用户名。 |
test |
| Secret |
string |
是 |
密钥。 |
xxxxx |
| IdentityType |
string |
是 |
身份类型。
|
USER |
| ClientId |
string |
否 |
当身份类型是 CLIENT 时,指定设备的 ClientID。 |
GID_test@@@test |
| SignMode |
string |
是 |
签名校验方式,ORIGIN:原始值比较,即比较 password 与 secret,SIGNED: 对 clientId 进行 HmacSHA1 加签(使用 secret,参考签名模式)验证,然后比较 password。 |
SIGNED |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
020F6A43-19E6-4B6E-B846-44EB31DF**** |
| Code |
integer |
状态码。说明 200 表示成功。 |
200 |
| Success |
boolean |
操作是否成功。true 表示成功,false 表示失败。 |
True |
| Message |
string |
返回信息。 |
operation success. |
示例
正常返回示例
JSON格式
{
"RequestId": "020F6A43-19E6-4B6E-B846-44EB31DF****",
"Code": 200,
"Success": true,
"Message": "operation success."
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InstancePermissionCheckFailed | An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. | 实例权限校验失败,请确认MQTT实例的所属关系以及授权策略。 |
| 400 | InvalidParameter.%s | An error occurred while validating the parameter. The parameter may be missing or invalid. | 参数校验失败,可能缺失或者传入值非法。 |
| 400 | Customauth.over.capacity | Over custom auth capacity. | 自定义权限数量容量超限 |
| 404 | ApiNotSupport | The specified API is not supported. | 当前接口不支持,请检查。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。