All Products
Search
Document Center

Microservices Engine:UpdateGatewayAuth

Last Updated:Jul 28, 2026

Updates gateway 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

mse:UpdateGatewayAuth

update

*Gateway

acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The authentication name.

test

Type

string

No

The authentication type. Valid values:

  • JWT

  • OIDC

  • IDaaS

  • ExternalAuthZ: a self-managed authentication service.

ExternalAuthZ

Issuer

string

No

Used when the authentication type is JWT or OIDC:

  • JWT: the iss (issuer) in JWT claims, which specifies the token issuer.

  • OIDC: the iss (issuer) in OIDC claims, which specifies the token issuer.

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:

  • HEADER: transmitted through a header.

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: Bearer token.

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: Authorization: Bearer token.

Bearer

TokenPass

boolean

No

Specifies whether to pass through the token.

true

Status

boolean

No

The enabled status. Valid values:

  • false: disabled.

  • true: enabled.

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 Cookie-domain=a.example.com, the cookie is sent to the domain name a.example.com. If you set Cookie-domain=.example.com, the cookie is sent to all subdomains of example.com.

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: strict mode. When the authentication service is unavailable (connection establishment fails or a 5xx response is returned), the gateway rejects client requests.

  • false: loose mode. When the authentication service is unavailable (connection establishment fails or a 5xx response is returned), the gateway allows client requests.

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: whitelist mode. Hosts and paths in the list can be accessed without verification. All others require verification.

  • false: blacklist mode. Hosts and paths in the list require verification. All others can be accessed directly.

true

AuthResourceMode

integer

No

The authorization resource mode. Valid values:

  • 0: simple mode.

  • 1: complex mode.

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: exact match.

  • PRE: prefix match.

  • ERGULAR: regular expression match.

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:

  • true: case sensitivity is enabled.

  • false: case sensitivity is disabled.

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: equal to.

  • NOT_EQUAL: not equal to.

  • EXIST: exists.

  • NOT_EXIST: does not exist.

  • INCLUDE: contains.

  • EXCLUDE: does not contain.

  • PREFIX: prefix.

  • SUFFIX: suffix.

  • REGREX: regular expression.

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: The request was successful.

  • false: The request failed.

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.