Tous les produits
Search
Centre de documentation

:GetGatewayAuthDetail

Dernière mise à jour :Aug 06, 2026

Obtient les détails d'authentification d'une passerelle.

Testez maintenant

Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.

Test

Autorisation RAM

Le tableau ci-dessous décrit les autorisations nécessaires pour appeler cette API. Vous pouvez les définir dans une politique Resource Access Management (RAM). Les colonnes du tableau sont détaillées ci-dessous :

  • Action : les actions peuvent être utilisées dans l'élément Action des instructions de politique de permissions RAM pour accorder les autorisations nécessaires à l'exécution de l'opération.

  • API : l'API que vous pouvez appeler pour exécuter l'action.

  • Niveau d'accès : le niveau d'accès prédéfini accordé pour chaque API. Valeurs valides : create, list, get, update et delete.

  • Type de ressource : le type de ressource qui prend en charge l'autorisation pour exécuter l'action. Il indique si l'action prend en charge les permissions au niveau de la ressource. La ressource spécifiée doit être compatible avec l'action. Sinon, la politique sera inefficace.

    • Pour les API avec permissions au niveau de la ressource, les types de ressource requis sont marqués d'un astérisque (*). Spécifiez l'Alibaba Cloud Resource Name (ARN) correspondant dans l'élément Resource de la politique.

    • Pour les API sans permissions au niveau de la ressource, la valeur All Resources est affichée. Utilisez un astérisque (*) dans l'élément Resource de la politique.

  • Clé de condition : les clés de condition définies par le service. La clé permet un contrôle granulaire, applicable aux actions seules ou aux actions associées à des ressources spécifiques. En plus des clés de condition propres au service, Alibaba Cloud fournit un ensemble de clés de condition communes applicables à tous les services pris en charge par RAM.

  • Action dépendante : les actions dépendantes requises pour exécuter l'action. Pour mener à bien l'opération, l'utilisateur RAM ou le rôle RAM doit disposer des permissions pour toutes les actions dépendantes.

mse:GetGatewayAuthDetail

get

*Gateway

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

Aucune Aucune

Paramètres de requête

Paramètre

Type

Requis

Description

Exemple

Id

integer

Non

L'identifiant de l'authentification.

1100

GatewayId

integer

Non

L'identifiant de la passerelle. Spécifiez ce paramètre ou GatewayUniqueId.

2274

GatewayUniqueId

string

Non

L'identifiant unique de la passerelle. Spécifiez ce paramètre ou GatewayId. Si les deux sont spécifiés, GatewayUniqueId est prioritaire.

gw-6f0dbd108a0249d2b675b3ef50b*****

AcceptLanguage

string

Non

La langue de la réponse. Valeurs valides :

zh

Éléments de réponse

Élément

Type

Description

Exemple

object

Le schéma de la réponse.

RequestId

string

L'identifiant de la requête.

9C96CDF8-9E6C-XXXX-XXXX-8F87A10117E6

HttpStatusCode

integer

Le code d'état HTTP.

200

Message

string

Le message renvoyé.

OK

Code

integer

Le code de réponse. Cette valeur est synchronisée avec le paramètre Success. Lorsque Success est true, la valeur de ce paramètre est 200.

200

Success

boolean

Indique si la requête a réussi.

true

Data

object

Les détails de l'authentification.

Id

integer

L'identifiant de l'authentification.

1100

Name

string

Le nom de l'authentification.

test

GatewayUniqueId

string

L'identifiant unique de la passerelle associée.

gw-6f0dbd108a0249d2b675b3ef50b*****

GatewayId

integer

L'identifiant de la passerelle associée.

2274

Type

string

Le type d'authentification. Valeurs valides :

JWT

Issuer

string

L'émetteur du jeton. Ce paramètre n'est renvoyé que si le type d'authentification est JWT ou OIDC.

https://example.com/auth

Jwks

string

La clé publique JWT, au format JSON.

{\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

Le mode d'autorisation.

true

GmtCreate

string

L'heure de création de l'authentification, en GMT.

2024-02-19T02:41:03.000+0000

GmtModified

string

L'heure de la dernière modification de l'authentification, en GMT.

2024-02-19T02:41:03.000+0000

TokenPosition

string

L'emplacement du JWT.

HEADER

TokenName

string

Le nom de l'en-tête de requête qui transporte le jeton. En général, il s'agit de Authorization.

Authorization

TokenNamePrefix

string

Le préfixe du jeton JWT.

Bearer

TokenPass

boolean

Indique si le jeton doit être transmis au service backend après l'authentification.

true

Status

boolean

Indique si l'authentification est activée.

false

RedirectUrl

string

L'URL de redirection en cas d'authentification OIDC ou IDaaS réussie. Cette URL doit correspondre à celle configurée dans votre fournisseur d'identité.

https://yourdomain/path

ClientId

string

L'identifiant de l'application enregistrée auprès du service OIDC ou IDaaS.

example-app

ClientSecret

string

Le secret de l'application enregistrée auprès du service OIDC ou IDaaS.

xxxxx

CookieDomain

string

Le domaine de cookie utilisé pour maintenir la session de connexion après une authentification OIDC ou IDaaS réussie.

hello.com

ScopesList

string

Les étendues de l'authentification OIDC.

["openid","email"]

LoginUrl

string

L'URL de la page de connexion de l'utilisateur pour l'authentification IDaaS.

https://daxxxxcn.aliyunidaas.com/

Sub

string

Le sujet (sub) des revendications JWT. Ceci est renvoyé lorsque le type d'authentification est JWT.

https://example.com/auth

ExternalAuthZ

object

Les détails de l'authentification personnalisée.

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 or Cookie.

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: strict mode. The gateway rejects client requests if the authentication service is unavailable (for example, due to a connection failure or a 5xx error).

  • false: loose mode. The gateway allows client requests to bypass authentication if the authentication service is unavailable.

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>

Une liste de règles d'autorisation. Ces règles sont combinées à l'aide d'un OU logique. Au sein de chaque règle, toutes les conditions de correspondance doivent être remplies (ET logique).

array<object>

Une règle d'autorisation.

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: whitelist mode. Requests for the hosts and paths in the list can bypass authentication. All other requests require authentication.

  • false: blacklist mode. Requests for the hosts and paths in the list require authentication. All other requests can bypass authentication.

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

  • PRE: prefix match

  • REGULAR: regular expression match

EQUAL

IgnoreCase

boolean

Specifies whether the path matching is case-sensitive.

  • true: Path matching is case-insensitive.

  • false: 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: equals

  • NOT_EQUAL: does not equal

  • EXIST: exists

  • NOT_EXIST: does not exist

  • INCLUDE: contains

  • EXCLUDE: does not contain

  • PREFIX: starts with

  • SUFFIX: ends with

  • REGEX: matches a regular expression

EQUAL

HeaderValue

string

The header value to match.

123

AuthResourceMode

integer

Le mode de ressource d'autorisation. Valeurs valides :

0

AuthResourceConfig

string

La configuration YAML pour le mode complexe.

permissions:

Exemples

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"
  }
}

Codes d'erreur

Code de statut HTTP

Code d'erreur

Message d'erreur

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

Consultez Codes d'erreur pour la liste complète.

Notes de version

Consultez Notes de version pour la liste complète.