修改自定义认证
功能介绍
修改自定义认证
URI
HTTP/HTTPS请求方法以及URI如下表所示。
请求方法 | URI |
|---|---|
PUT | /v1/{project_id}/apigw/instances/{instance_id}/authorizers/{id} |
URI中的参数说明如下表所示。
名称 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
project_id | 是 | String | 项目ID。可从控制台“我的凭证”中获取region下项目ID,管理员权限可查询。 |
instance_id | 是 | String | 实例ID,可从API网关控制台的专享版实例信息中获取。 |
id | 是 | String | 自定义认证的ID |
请求消息
名称 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
name | 是 | String | 自定义认证的名称。 长度为3 ~ 64位的字符串,字符串由中文、英文字母、数字、“_”组成,且只能以英文或中文开头。 |
type | 是 | String | 自定义认证类型:
|
authorizer_type | 是 | String | 只能为:FUNC |
authorizer_uri | 是 | String | 函数urn |
identities | 否 | List | 认证来源 |
ttl | 否 | Integer | 缓存时间 |
user_data | 否 | String | 用户数据 |
名称 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
name | 是 | String | 参数名称 |
location | 是 | String | 参数位置:
|
请求消息样例:
{
"name":"Authorizer_9dlh",
"type":"FRONTEND",
"authorizer_type":"FUNC",
"authorizer_uri":"urn:fss:regionexample:dbb5762c88f045c6a1427a952bcae284:function:default:test111",
"ttl":10,
"user_data":"aaaa",
"identities":[
{
"name":"Authorization",
"location":"HEADER"
}
]
} 响应消息
名称 | 类型 | 说明 |
|---|---|---|
id | String | 编号 |
name | String | 自定义认证的名称 |
type | String | 自定义认证类型:
|
authorizer_type | String | 只能为:FUNC |
authorizer_uri | String | 函数urn |
identities | Array | 认证来源 |
ttl | Integer | 缓存时间 |
user_data | String | 用户数据 |
create_time | Time | 创建时间 |
名称 | 类型 | 说明 |
|---|---|---|
name | String | 参数名称 |
location | String | 参数位置:
|
响应消息样例:
{
"name":"Authorizer_9dlh",
"type":"FRONTEND",
"authorizer_type":"FUNC",
"authorizer_uri":"urn:fss:regionexample:dbb5762c88f045c6a1427a952bcae284:function:default:test111",
"identities":[
{
"name":"Authorization",
"location":"HEADER",
}
],
"ttl":10,
"user_data":"aaaa",
"id":"7345e3fe4047491ebd8ecb0acd665a4c",
"create_time":"2020-01-19T11:48:56.576611862Z"
} 状态码
状态码 | 说明 |
|---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Server Internal Error |

