Retrieves the authentication details of a gateway.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:GetGatewayAuthDetail |
get |
*Gateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Id |
integer |
No |
The authentication ID. |
1100 |
| GatewayId |
integer |
No |
The gateway ID. Specify this parameter or |
2274 |
| GatewayUniqueId |
string |
No |
The unique gateway ID. Specify this parameter or |
gw-6f0dbd108a0249d2b675b3ef50b***** |
| AcceptLanguage |
string |
No |
The language of the response. Valid values:
|
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| RequestId |
string |
The request ID. |
9C96CDF8-9E6C-XXXX-XXXX-8F87A10117E6 |
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Message |
string |
The returned message. |
OK |
| Code |
integer |
The response code. This value is synchronized with the |
200 |
| Success |
boolean |
Indicates whether the request was successful. |
true |
| Data |
object |
The details of the authentication. |
|
| Id |
integer |
The authentication ID. |
1100 |
| Name |
string |
The name of the authentication. |
test |
| GatewayUniqueId |
string |
The unique ID of the associated gateway. |
gw-6f0dbd108a0249d2b675b3ef50b***** |
| GatewayId |
integer |
The ID of the associated gateway. |
2274 |
| Type |
string |
The authentication type. Valid values:
|
JWT |
| Issuer |
string |
The token issuer. This parameter is returned only if the authentication type is
|
https://example.com/auth |
| Jwks |
string |
The JWT public key, in JSON format. |
{\n \"keys\":[\n {\n \"kty\": \"RSA\",\n \"e\": \"AQAB\",\n \"use\": \"sig\",\n \"kid\": \"1rGufmH1YN8rqM9ZOLgo7eEST3AnL89Y-m-XGFioLoA\",\n \"alg\": \"RS256\",\n \"n\": \"rM2GIc0YTMqwNCwXnjKbW5QndkCEZgyLu3uQUnyZF7HvMTekiTvQg_39mg3dV1eaYYkYfZBogyroJBqAQXhk6VVCxlBjFVp2xstJPVWngMOOlcafwN_BKdN-EQ06O_Uu__e7gNKI3DunkNk0cNaFETE7d4meRYyTlgEzYgsrW05_ufR0BKoddL3E5JsCpUxRjH9ICbodBx0U74W6Dcci-R2EA1DBrEcboE6n90uoJs6UJNriAK_71nAsYonihU5aQFFnyPTkJHfRwHK6JlME6rn-b-rpLSpdyc6U1nOFZP2DEpz8U5FrYoLYSZIU-MQGxDhCnGc_rxl2IyP9B2qcCQ\"\n }\n ]\n}\n |
| IsWhite |
boolean |
The authorization mode.
|
true |
| GmtCreate |
string |
The time when the authentication was created, in GMT. |
2024-02-19T02:41:03.000+0000 |
| GmtModified |
string |
The time when the authentication was last modified, in GMT. |
2024-02-19T02:41:03.000+0000 |
| TokenPosition |
string |
The location of the JWT.
|
HEADER |
| TokenName |
string |
The name of the request header that carries the token. Typically, this is |
Authorization |
| TokenNamePrefix |
string |
The prefix of the JWT token. |
Bearer |
| TokenPass |
boolean |
Specifies whether to pass the token to the backend service after authentication. |
true |
| Status |
boolean |
Indicates whether authentication is enabled. |
false |
| RedirectUrl |
string |
The redirect URL for successful OIDC or IDaaS authentication. This URL must match the one configured in your identity provider. |
https://yourdomain/path |
| ClientId |
string |
The application ID registered with the OIDC or IDaaS service. |
example-app |
| ClientSecret |
string |
The application secret registered with the OIDC or IDaaS service. |
xxxxx |
| CookieDomain |
string |
The cookie domain used to maintain the login session after successful OIDC or IDaaS authentication. |
hello.com |
| ScopesList |
string |
The scopes of the OIDC authentication. |
["openid","email"] |
| LoginUrl |
string |
The URL of the user sign-in page for IDaaS authentication. |
https://daxxxxcn.aliyunidaas.com/ |
| Sub |
string |
The subject ( |
https://example.com/auth |
| ExternalAuthZ |
object |
The details of the custom authentication. |
|
| ServiceId |
integer |
The authentication service ID. |
15300 |
| PrefixPath |
string |
The path of the authentication API. |
/auth |
| TokenKey |
string |
The request header that contains the token, such as |
Authorization |
| AllowRequestHeaders |
array |
The allowed request headers. |
|
|
string |
The name of the allowed request header. |
x-req |
|
| AllowUpstreamHeaders |
array |
The allowed response headers. |
|
|
string |
The name of the allowed response header. |
x-resp |
|
| Timeout |
integer |
The timeout for the authentication service, in seconds. |
10 |
| IsRestrict |
boolean |
The custom authentication mode.
|
true |
| Service |
object |
Details of the authentication service. |
|
| Name |
string |
The name of the authentication service. |
httpbin-auth-service |
| SourceType |
string |
The source type of the authentication service. |
K8s |
| GroupName |
string |
The group to which the authentication service belongs. |
test |
| Namespace |
string |
The namespace of the authentication service. |
default |
| WithRequestBody |
boolean |
Specifies whether to forward the request body to the authentication service. |
true |
| BodyMaxBytes |
integer |
The maximum size of the request body, in bytes. |
4000000 |
| WithRematchRoute |
boolean |
Specifies whether to rematch the route after authentication. |
|
| ResourceList |
array<object> |
A list of authorization rules. These rules are combined using a logical OR. Within each rule, all match conditions must be met (logical AND). |
|
|
array<object> |
An authorization rule. |
||
| Id |
integer |
The ID of the authorization rule. |
1303 |
| AuthId |
integer |
The ID of the authentication to which this rule belongs. |
2274 |
| DomainId |
integer |
The ID of the domain name in the rule. |
1765 |
| DomainName |
string |
The domain name in the rule. |
example.com |
| Path |
string |
The path pattern of the rule. |
/test |
| IsWhite |
boolean |
The authorization mode.
|
true |
| GatewayId |
integer |
The ID of the associated gateway. |
2274 |
| GatewayUniqueId |
string |
The unique ID of the associated gateway. |
gw-6f0dbd108a0249d2b675b3ef50b***** |
| GmtCreate |
string |
The time when the authorization rule was created, in GMT. |
2024-02-19T03:32:38.000+0000 |
| GmtModified |
string |
The time when the authorization rule was last modified, in GMT. |
2024-02-19T03:32:38.000+0000 |
| MatchType |
string |
The match type for the request path. Valid values:
|
EQUAL |
| IgnoreCase |
boolean |
Specifies whether the path matching is case-sensitive.
|
true |
| AuthResourceHeaderList |
array<object> |
A list of match conditions based on request headers. This parameter applies only to custom authentication. |
|
|
object |
|||
| HeaderKey |
string |
The name of the request header. |
x-req |
| HeaderMethod |
string |
The match condition. Valid values:
|
EQUAL |
| HeaderValue |
string |
The header value to match. |
123 |
| AuthResourceMode |
integer |
The authorization resource mode. Valid values:
|
0 |
| AuthResourceConfig |
string |
The YAML configuration for the complex mode. |
permissions: - not_rule: or_rules: rules: - and_rules: rules: - url_path: path: ignore_case: false prefix: /version - and_rules: rules: - url_path: path: ignore_case: false prefix: /header |
Examples
Success response
JSON format
{
"RequestId": "9C96CDF8-9E6C-XXXX-XXXX-8F87A10117E6",
"HttpStatusCode": 200,
"Message": "OK",
"Code": 200,
"Success": true,
"Data": {
"Id": 1100,
"Name": "test",
"GatewayUniqueId": "gw-6f0dbd108a0249d2b675b3ef50b*****",
"GatewayId": 2274,
"Type": "JWT",
"Issuer": "https://example.com/auth",
"Jwks": "{\\n \\\"keys\\\":[\\n {\\n \\\"kty\\\": \\\"RSA\\\",\\n \\\"e\\\": \\\"AQAB\\\",\\n \\\"use\\\": \\\"sig\\\",\\n \\\"kid\\\": \\\"1rGufmH1YN8rqM9ZOLgo7eEST3AnL89Y-m-XGFioLoA\\\",\\n \\\"alg\\\": \\\"RS256\\\",\\n \\\"n\\\": \\\"rM2GIc0YTMqwNCwXnjKbW5QndkCEZgyLu3uQUnyZF7HvMTekiTvQg_39mg3dV1eaYYkYfZBogyroJBqAQXhk6VVCxlBjFVp2xstJPVWngMOOlcafwN_BKdN-EQ06O_Uu__e7gNKI3DunkNk0cNaFETE7d4meRYyTlgEzYgsrW05_ufR0BKoddL3E5JsCpUxRjH9ICbodBx0U74W6Dcci-R2EA1DBrEcboE6n90uoJs6UJNriAK_71nAsYonihU5aQFFnyPTkJHfRwHK6JlME6rn-b-rpLSpdyc6U1nOFZP2DEpz8U5FrYoLYSZIU-MQGxDhCnGc_rxl2IyP9B2qcCQ\\\"\\n }\\n ]\\n}\\n",
"IsWhite": true,
"GmtCreate": "2024-02-19T02:41:03.000+0000",
"GmtModified": "2024-02-19T02:41:03.000+0000",
"TokenPosition": "HEADER",
"TokenName": "Authorization",
"TokenNamePrefix": "Bearer ",
"TokenPass": true,
"Status": false,
"RedirectUrl": "https://yourdomain/path",
"ClientId": "example-app",
"ClientSecret": "xxxxx",
"CookieDomain": "hello.com",
"ScopesList": "[\"openid\",\"email\"]",
"LoginUrl": "https://daxxxxcn.aliyunidaas.com/",
"Sub": "https://example.com/auth",
"ExternalAuthZ": {
"ServiceId": 15300,
"PrefixPath": "/auth",
"TokenKey": "Authorization",
"AllowRequestHeaders": [
"x-req"
],
"AllowUpstreamHeaders": [
"x-resp"
],
"Timeout": 10,
"IsRestrict": true,
"Service": {
"Name": " httpbin-auth-service",
"SourceType": "K8s",
"GroupName": "test",
"Namespace": "default"
},
"WithRequestBody": true,
"BodyMaxBytes": 4000000,
"WithRematchRoute": false
},
"ResourceList": [
{
"Id": 1303,
"AuthId": 2274,
"DomainId": 1765,
"DomainName": "example.com",
"Path": "/test",
"IsWhite": true,
"GatewayId": 2274,
"GatewayUniqueId": "gw-6f0dbd108a0249d2b675b3ef50b*****",
"GmtCreate": "2024-02-19T03:32:38.000+0000",
"GmtModified": "2024-02-19T03:32:38.000+0000",
"MatchType": "EQUAL",
"IgnoreCase": true,
"AuthResourceHeaderList": [
{
"HeaderKey": "x-req",
"HeaderMethod": "EQUAL",
"HeaderValue": "123"
}
]
}
],
"AuthResourceMode": 0,
"AuthResourceConfig": "permissions:\n - not_rule:\n or_rules:\n rules:\n - and_rules:\n rules:\n - url_path:\n path:\n ignore_case: false\n prefix: /version\n - and_rules:\n rules:\n - url_path:\n path:\n ignore_case: false\n prefix: /header"
}
}
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.