Authorization - List By Authorization Provider
列出授權提供者內定義的授權提供者集合。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations?api-version=2022-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2022-08-01
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
authorization
|
path | True |
string |
授權提供者的標識碼。 Regex 模式: |
resource
|
path | True |
string |
資源群組的名稱。 名稱不區分大小寫。 |
service
|
path | True |
string |
API 管理 服務的名稱。 Regex 模式: |
subscription
|
path | True |
string |
目標訂用帳戶的標識碼。 |
api-version
|
query | True |
string |
用於此作業的 API 版本。 |
$filter
|
query |
string |
|欄位 |使用量 |支持的運算子 |支援的函式 | |
|
$skip
|
query |
integer int32 |
要略過的記錄數目。 |
|
$top
|
query |
integer int32 |
要傳回的記錄數目。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
指定之授權提供者的授權實體集合。 |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
Api |
Api |
ApiManagementListAuthorizationsAuthCode
範例要求
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations?api-version=2022-08-01
範例回覆
{
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1",
"type": "Microsoft.ApiManagement/service/authorizationProviders/authorizations",
"name": "authz1",
"properties": {
"authorizationType": "OAuth2",
"oauth2grantType": "AuthorizationCode",
"status": "Connected"
}
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz2",
"type": "Microsoft.ApiManagement/service/authorizationProviders/authorizations",
"name": "authz2",
"properties": {
"authorizationType": "OAuth2",
"oauth2grantType": "AuthorizationCode",
"status": "Error",
"error": {
"code": "Unauthenticated",
"message": "This connection is not authenticated."
}
}
}
],
"nextLink": ""
}
ApiManagementListAuthorizationsClientCred
範例要求
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations?api-version=2022-08-01
範例回覆
{
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations/authz1",
"type": "Microsoft.ApiManagement/service/authorizationProviders/authorizations",
"name": "authz1",
"properties": {
"authorizationType": "OAuth2",
"oauth2grantType": "ClientCredentials",
"parameters": {
"clientId": "53790925-fdd3-4b80-bc7a-4c3aaf25801d"
},
"status": "Connected"
}
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations/authz2",
"type": "Microsoft.ApiManagement/service/authorizationProviders/authorizations",
"name": "authz2",
"properties": {
"authorizationType": "OAuth2",
"oauth2grantType": "ClientCredentials",
"parameters": {
"clientId": "53790925-fdd3-4b80-bc7a-4c3aaf25801d"
},
"status": "Error",
"error": {
"code": "Unauthorized",
"message": "Failed to acquire access token for service using client credentials flow: IdentityProvider=aadwithclientcred. Correlation Id=6299d09b-03b7-46ed-b355-0453451d7e49, UTC TimeStamp=5/14/2022 4:53:19 PM, Error: Failed to exchange client credentials for token. Response code=Unauthorized, Details:\r\n{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '53790925-fdd3-4b80-bc7a-4c3aaf25801d'.\\r\\nTrace ID: 4a18d3cd-9ad5-4664-b3eb-daaa2f435f00\\r\\nCorrelation ID: dde60c16-35cb-4572-8226-bfb4233af8d7\\r\\nTimestamp: 2022-05-14 16:53:19Z\",\"error_codes\":[7000215],\"timestamp\":\"2022-05-14 16:53:19Z\",\"trace_id\":\"4a18d3cd-9ad5-4664-b3eb-daaa2f435f00\",\"correlation_id\":\"dde60c16-35cb-4572-8226-bfb4233af8d7\",\"error_uri\":\"https://login.windows.net/error?code=7000215\"}"
}
}
}
],
"nextLink": ""
}
定義
名稱 | Description |
---|---|
Authorization |
分頁授權清單表示法。 |
Authorization |
授權合約。 |
Authorization |
授權錯誤詳細數據。 |
Authorization |
授權類型選項 |
Error |
錯誤欄位合約。 |
Error |
錯誤回應。 |
OAuth2Grant |
OAuth2 授與類型選項 |
AuthorizationCollection
分頁授權清單表示法。
名稱 | 類型 | Description |
---|---|---|
count |
integer |
所有頁面的總記錄計數數目。 |
nextLink |
string |
如果有的話,下一頁連結。 |
value |
頁面值。 |
AuthorizationContract
授權合約。
名稱 | 類型 | Description |
---|---|---|
id |
string |
資源的完整資源識別碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
資源的名稱 |
properties.authorizationType |
授權類型選項 |
|
properties.error | ||
properties.oauth2grantType |
OAuth2 授與類型選項 |
|
properties.parameters |
object |
授權參數 |
properties.status |
string |
授權的狀態 |
type |
string |
資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts” |
AuthorizationError
授權錯誤詳細數據。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼 |
message |
string |
錯誤訊息 |
AuthorizationType
授權類型選項
名稱 | 類型 | Description |
---|---|---|
OAuth2 |
string |
OAuth2 授權類型 |
ErrorFieldContract
錯誤欄位合約。
名稱 | 類型 | Description |
---|---|---|
code |
string |
屬性層級錯誤碼。 |
message |
string |
人類可讀取的屬性層級錯誤表示法。 |
target |
string |
屬性名稱。 |
ErrorResponse
錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error.code |
string |
服務定義的錯誤碼。 此代碼會作為回應中指定之 HTTP 錯誤碼的子狀態。 |
error.details |
在驗證錯誤時,要求中傳送的無效欄位清單。 |
|
error.message |
string |
人類可閱讀的錯誤表示法。 |
OAuth2GrantType
OAuth2 授與類型選項
名稱 | 類型 | Description |
---|---|---|
AuthorizationCode |
string |
授權碼授與 |
ClientCredentials |
string |
客戶端認證授與 |