你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Authorization Server - List By Service

列出服务实例中定义的授权服务器集合。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers?api-version=2022-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2022-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

serviceName
path True

string

API 管理服务的名称。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目标订阅的 ID。

api-version
query True

string

要用于此操作的 API 版本。

$filter
query

string

|字段 |使用情况 |支持的运算符 |支持的函数 |
|-------------|-------------|-------------|-------------|
|name |filter |ge、le、eq、ne、gt、lt |substringof, contains, startswith, endswith |
|displayName |filter |ge、le、eq、ne、gt、lt |substringof、 contains、 startswith、 endswith |

$skip
query

integer

int32

要跳过的记录数。

$top
query

integer

int32

要返回的记录数。

响应

名称 类型 说明
200 OK

AuthorizationServerCollection

指定API 管理服务实例的授权服务器实体的集合。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ApiManagementListAuthorizationServers

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers?api-version=2022-08-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer",
      "type": "Microsoft.ApiManagement/service/authorizationServers",
      "name": "newauthServer",
      "properties": {
        "displayName": "test2",
        "useInTestConsole": true,
        "useInApiDocumentation": false,
        "description": "test server",
        "clientRegistrationEndpoint": "https://www.contoso.com/apps",
        "authorizationEndpoint": "https://www.contoso.com/oauth2/auth",
        "authorizationMethods": [
          "GET"
        ],
        "tokenEndpoint": "https://www.contoso.com/oauth2/token",
        "supportState": true,
        "defaultScope": "read write",
        "grantTypes": [
          "authorizationCode",
          "implicit"
        ],
        "bearerTokenSendingMethods": [
          "authorizationHeader"
        ],
        "clientId": "1",
        "resourceOwnerUsername": "un",
        "resourceOwnerPassword": "pwd"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer2",
      "type": "Microsoft.ApiManagement/service/authorizationServers",
      "name": "newauthServer2",
      "properties": {
        "displayName": "test3",
        "useInTestConsole": false,
        "useInApiDocumentation": true,
        "description": "test server",
        "clientRegistrationEndpoint": "https://www.contoso.com/apps",
        "authorizationEndpoint": "https://www.contoso.com/oauth2/auth",
        "authorizationMethods": [
          "GET"
        ],
        "clientAuthenticationMethod": [
          "Basic"
        ],
        "tokenEndpoint": "https://www.contoso.com/oauth2/token",
        "supportState": true,
        "defaultScope": "read write",
        "grantTypes": [
          "authorizationCode",
          "implicit"
        ],
        "bearerTokenSendingMethods": [
          "authorizationHeader"
        ],
        "clientId": "1",
        "resourceOwnerUsername": "un",
        "resourceOwnerPassword": "pwd"
      }
    }
  ],
  "nextLink": ""
}

定义

名称 说明
AuthorizationMethod

授权终结点支持的 HTTP 谓词。 GET 必须始终存在。 POST 是可选的。

AuthorizationServerCollection

分页 OAuth2 授权服务器列表表示形式。

AuthorizationServerContract

外部 OAuth 授权服务器设置。

BearerTokenSendingMethod

指定用于向 API 传递访问令牌的机制。

ClientAuthenticationMethod

此授权服务器的令牌终结点支持的身份验证方法。 可能的值为 Basic 和/或 Body。 指定 Body 时,客户端凭据和其他参数以 application/x-www-form-urlencoded 格式在请求正文中传递。

ErrorFieldContract

错误字段协定。

ErrorResponse

错误响应。

GrantType

授权的形式,客户端使用该授权请求访问令牌。

TokenBodyParameterContract

OAuth (www-url-form-encoded) 获取令牌请求正文参数。

AuthorizationMethod

授权终结点支持的 HTTP 谓词。 GET 必须始终存在。 POST 是可选的。

名称 类型 说明
DELETE

string

GET

string

HEAD

string

OPTIONS

string

PATCH

string

POST

string

PUT

string

TRACE

string

AuthorizationServerCollection

分页 OAuth2 授权服务器列表表示形式。

名称 类型 说明
count

integer

所有页面的总记录计数数。

nextLink

string

下一页链接(如果有)。

value

AuthorizationServerContract[]

页面值。

AuthorizationServerContract

外部 OAuth 授权服务器设置。

名称 类型 说明
id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.authorizationEndpoint

string

OAuth 授权终结点。 请参阅 http://tools.ietf.org/html/rfc6749#section-3.2

properties.authorizationMethods

AuthorizationMethod[]

授权终结点支持的 HTTP 谓词。 GET 必须始终存在。 POST 是可选的。

properties.bearerTokenSendingMethods

BearerTokenSendingMethod[]

指定用于向 API 传递访问令牌的机制。

properties.clientAuthenticationMethod

ClientAuthenticationMethod[]

此授权服务器的令牌终结点支持的身份验证方法。 可能的值为 Basic 和/或 Body。 指定 Body 时,客户端凭据和其他参数以 application/x-www-form-urlencoded 格式在请求正文中传递。

properties.clientId

string

已注册到此授权服务器的客户端或应用程序 ID。

properties.clientRegistrationEndpoint

string

对执行此授权服务器的客户端或应用程序注册时所在页的可选引用。 包含所引用实体的绝对 URL。

properties.clientSecret

string

已注册到此授权服务器的客户端或应用程序机密。 此属性不会在“GET”操作上填充! 使用“/listSecrets”POST 请求获取值。

properties.defaultScope

string

将按默认请求的访问令牌作用域。 可以在 API 级别重写。 应以包含空格分隔值的字符串形式提供。

properties.description

string

授权服务器的说明。 可以包含采用 HTML 格式的标记。

properties.displayName

string

用户友好的授权服务器名称。

properties.grantTypes

GrantType[]

授权的形式,客户端使用该授权请求访问令牌。

properties.resourceOwnerPassword

string

当此授权服务器支持资源所有者密码授权类型时,可以根据需要指定。 默认的资源所有者密码。

properties.resourceOwnerUsername

string

当此授权服务器支持资源所有者密码授权类型时,可以根据需要指定。 默认的资源所有者用户名。

properties.supportState

boolean

如果为 true,授权服务器将包含授权请求中对其响应的状态参数。 客户端可以使用状态参数来引发协议安全性。

properties.tokenBodyParameters

TokenBodyParameterContract[]

此授权服务器的令牌终结点所需的其他参数表示为具有名称和值字符串属性的 JSON 对象数组,即 {“name” : “name value”, “value”: “a value”}。

properties.tokenEndpoint

string

OAuth 令牌终结点。 包含所引用实体的绝对 URI。

properties.useInApiDocumentation

boolean

如果为 true,则将在开发人员门户的 API 文档中使用授权服务器。 如果未提供任何值,则默认为 False。

properties.useInTestConsole

boolean

如果为 true,可以在开发人员门户测试控制台中使用授权服务器。 如果未提供任何值,则默认为 True。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

BearerTokenSendingMethod

指定用于向 API 传递访问令牌的机制。

名称 类型 说明
authorizationHeader

string

query

string

ClientAuthenticationMethod

此授权服务器的令牌终结点支持的身份验证方法。 可能的值为 Basic 和/或 Body。 指定 Body 时,客户端凭据和其他参数以 application/x-www-form-urlencoded 格式在请求正文中传递。

名称 类型 说明
Basic

string

基本客户端身份验证方法。

Body

string

基于正文的身份验证方法。

ErrorFieldContract

错误字段协定。

名称 类型 说明
code

string

属性级错误代码。

message

string

属性级错误的可读表示形式。

target

string

属性名称。

ErrorResponse

错误响应。

名称 类型 说明
error.code

string

服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。

error.details

ErrorFieldContract[]

在发生验证错误的情况下,在请求中发送的无效字段列表。

error.message

string

错误的用户可读表示形式。

GrantType

授权的形式,客户端使用该授权请求访问令牌。

名称 类型 说明
authorizationCode

string

授权代码授予流,如所述 https://tools.ietf.org/html/rfc6749#section-4.1

clientCredentials

string

客户端凭据授予流,如所述 https://tools.ietf.org/html/rfc6749#section-4.4

implicit

string

隐式代码授予流,如所述 https://tools.ietf.org/html/rfc6749#section-4.2

resourceOwnerPassword

string

资源所有者密码授予流,如所述 https://tools.ietf.org/html/rfc6749#section-4.3

TokenBodyParameterContract

OAuth (www-url-form-encoded) 获取令牌请求正文参数。

名称 类型 说明
name

string

body 参数名称。

value

string

body 参数值。