Updates gateway authentication.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:UpdateGatewayAuth |
update |
*Gateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
The authentication name. |
test |
| Type |
string |
No |
The authentication type. Valid values:
|
ExternalAuthZ |
| Issuer |
string |
No |
Used when the authentication type is JWT or OIDC:
|
test |
| Jwks |
string |
No |
The JWT public key. JSON format is supported. |
{"keys":[{"e":"AQAB","kid":"DHFbpoIUqrY8t2zpA2qXfCmr5VO5ZEr4RzHU_-envvQ","kty":"RSA","n":"xAE7eB6qugXyCAG3yhh7pkDkT65pHymX-P7KfIupjf59vsdo91bSP9C8H07pSAGQO1MV_xFj9VswgsCg4R6otmg5PV2He95lZdHtOcU5DXIg_pbhLdKXbi66GlVeK6ABZOUW3WYtnNHD-91gVuoeJT_DwtGGcp4ignkgXfkiEm4sw-4sfb4qdt5oLbyVpmW6x9cfa7vs2WTfURiCrBoUqgBo_-4WTiULmmHSGZHOjzwa8WtrtOQGsAFjIbno85jp6MnGGGZPYZbDAa_b3y5u-YpW7ypZrvD8BgtKVjgtQgZhLAGezMt0ua3DRrWnKqTZ0BJ_EyxOGuHJrLsn00fnMQ"}]} |
| TokenPosition |
string |
No |
The JWT token type. Valid values:
The token parameter information to be verified. By default, the token is placed in the Authorization header with the Bearer prefix. Example: Authorization: Bearer token. |
HEADER |
| TokenName |
string |
No |
The location where the JWT token is stored. The token parameter information to be verified. By default, the token is placed in the Authorization header with the Bearer prefix. Example: |
Authorization |
| TokenNamePrefix |
string |
No |
The prefix of the JWT token. The token parameter information to be verified. By default, the token is placed in the Authorization header with the Bearer prefix. Example: |
Bearer |
| TokenPass |
boolean |
No |
Specifies whether to pass through the token. |
true |
| Status |
boolean |
No |
The enabled status. Valid values:
|
true |
| Id |
integer |
No |
The authentication rule ID. |
719 |
| RedirectUrl |
string |
No |
The redirect URL after successful authorization. This parameter is used for OIDC/IDaaS and must be consistent with the redirect URL configured in OIDC/IDaaS. |
https://test-.com/oauth2/callback |
| ClientId |
string |
No |
The application ID registered with the service. This parameter is used for OIDC/IDaaS. |
app_mnvxaavggw7hcdcnr6usi6*** |
| ClientSecret |
string |
No |
The application secret registered with the OIDC authentication service. |
CS6EYfx3k9yTRR9EtQ2MXWP97P6UAUwFg4teoWJ19Z**** |
| CookieDomain |
string |
No |
The cookie domain name. After authentication succeeds, the cookie is sent to the specified domain name to maintain the logon state. Example: If you set |
test.com |
| ScopesList |
array |
No |
The OIDC authorization scopes. This parameter is used for OIDC. |
|
|
string |
No |
The OIDC authorization scopes. This parameter is used for OIDC. |
openid |
|
| LoginUrl |
string |
No |
The user logon page URL of the IDaaS instance. This parameter is used for IDaaS. |
https://daxxxxcn.aliyunidaas.com/ |
| Sub |
string |
No |
Used when the authentication type is JWT. The sub (subject) in JWT claims, which specifies the principal. Make sure that the value of the sub field in the JWT payload is consistent with the value configured here. If this parameter is not set or is empty, the value defaults to the value of the Issuer parameter. |
example-app |
| ExternalAuthZJSON |
object |
No |
The custom authentication information. |
|
| ServiceId |
integer |
No |
The authentication service ID. |
37396 |
| PrefixPath |
string |
No |
The path of the authentication API provided by the authentication service. The API path must use prefix matching. |
/auth |
| TokenKey |
string |
No |
The header in which the token is located in the request message. Common values include Authorization and Cookie. |
Authorization |
| AllowRequestHeaders |
array |
No |
The allowed request header names. |
|
|
string |
No |
The allowed request header names. |
x-req |
|
| AllowUpstreamHeaders |
array |
No |
The allowed response header names. |
|
|
string |
No |
The allowed response header names. |
x-resp |
|
| Timeout |
integer |
No |
The timeout period of the authentication service. Unit: seconds. |
10 |
| IsRestrict |
boolean |
No |
The custom authentication mode. Valid values:
|
true |
| WithRequestBody |
boolean |
No |
Specifies whether to allow carrying the body. |
true |
| BodyMaxBytes |
integer |
No |
The maximum number of bytes for the body. |
4000000 |
| WithRematchRoute |
boolean |
No |
Specifies whether to re-match routes after authentication is complete. |
true |
| GatewayUniqueId |
string |
No |
The unique ID of the gateway. |
gw-9cdcf8e4f58144059e73ff4c5ef9**** |
| IsWhite |
boolean |
No |
The authorization blacklist/whitelist mode. Valid values:
|
true |
| AuthResourceMode |
integer |
No |
The authorization resource mode. Valid values:
|
1 |
| AuthResourceConfig |
string |
No |
The YAML configuration for complex mode. |
'' |
| AuthResourceList |
array<object> |
No |
The list of authorization rules for authentication. Multiple rule conditions have an OR relationship. Multiple matching items within a rule condition have an AND relationship. |
|
|
array<object> |
No |
The list of authorization rules for authentication. Multiple rule conditions have an OR relationship. Multiple matching items within a rule condition have an AND relationship. |
||
| Id |
integer |
No |
The resource record ID. |
1 |
| DomainId |
integer |
No |
The ID of the domain name in the rule. |
1765 |
| Path |
string |
No |
The matching path of the rule. |
/test |
| MatchType |
string |
No |
The matching type for the request path. Valid values:
|
EQUAL |
| IgnoreCase |
boolean |
No |
Specifies whether case sensitivity is enabled for the path. This parameter is used when creating custom authentication. Other authentication types enable case sensitivity by default. Valid values:
|
|
| AuthResourceHeaderList |
array<object> |
No |
The request headers of the rule. Currently only used for custom authentication. |
|
|
object |
No |
The request headers of the rule. Currently only used for custom authentication. |
||
| HeaderKey |
string |
No |
The request header name. |
x-req |
| HeaderMethod |
string |
No |
The matching condition. Valid values:
|
EQUAL |
| HeaderValue |
string |
No |
The value of the request header. |
123 |
| DeleteResourceIdList |
array |
No |
The list of resource record IDs to delete. |
|
|
integer |
No |
The resource record ID to delete. |
2 |
|
|
No |
The language of the response. Valid values: zh (default): Chinese. en: English. |
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
316F5F64-F73D-42DC-8632-01E308B6**** |
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Message |
string |
The returned message. |
OK |
| Code |
integer |
The response code. The value is synchronized with the success parameter. |
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| Data |
integer |
The authentication rule ID. |
719 |
Examples
Success response
JSON format
{
"RequestId": "316F5F64-F73D-42DC-8632-01E308B6****",
"HttpStatusCode": 200,
"Message": "OK",
"Code": 200,
"Success": true,
"Data": 719
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.