次の方法で共有


Authorization Server - Create Or Update

新しい承認サーバーを作成するか、既存の承認サーバーを更新します。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}?api-version=2021-08-01

URI パラメーター

名前 / 必須 説明
authsid
path True

string

minLength: 1
maxLength: 80
pattern: ^[^*#&+:<>?]+$

承認サーバーの識別子。

resourceGroupName
path True

string

リソース グループの名前。

serviceName
path True

string

minLength: 1
maxLength: 50
pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

API Management サービスの名前。

subscriptionId
path True

string

Microsoft Azure サブスクリプションを一意に識別するサブスクリプション資格情報。 サブスクリプション ID は、すべてのサービス呼び出しの URI の一部を形成します。

api-version
query True

string

クライアント要求で使用する API のバージョン。

要求ヘッダー

名前 必須 説明
If-Match

string

エンティティの ETag。 エンティティを作成する場合は必要ありませんが、エンティティを更新する場合は必須です。

要求本文

名前 必須 説明
properties.authorizationEndpoint True

string

OAuth 承認エンドポイント。 http://tools.ietf.org/html/rfc6749#section-3.2を参照してください。

properties.clientId True

string

この承認サーバーに登録されているクライアントまたはアプリ ID。

properties.clientRegistrationEndpoint True

string

この承認サーバーのクライアントまたはアプリの登録が実行されるページへの省略可能な参照。 参照されるエンティティへの絶対 URL が含まれています。

properties.displayName True

string

minLength: 1
maxLength: 50

ユーザー フレンドリな承認サーバー名。

properties.grantTypes True

GrantType[]

クライアントがアクセス トークンを要求するために使用する承認付与の形式。

properties.authorizationMethods

AuthorizationMethod[]

承認エンドポイントでサポートされている HTTP 動詞。 GET は常に存在する必要があります。 POST は省略可能です。

properties.bearerTokenSendingMethods

BearerTokenSendingMethod[]

アクセス トークンを API に渡すメカニズムを指定します。

properties.clientAuthenticationMethod

ClientAuthenticationMethod[]

この承認サーバーのトークン エンドポイントでサポートされる認証方法。 使用できる値は Basic または Body です。 Body を指定すると、クライアント資格情報とその他のパラメーターが要求本文内でアプリケーション/x-www-form-urlencoded 形式で渡されます。

properties.clientSecret

string

この承認サーバーに登録されているクライアントまたはアプリ シークレット。 このプロパティは'GET' 操作では入力されません。 値を取得するには、'/listSecrets' POST 要求を使用します。

properties.defaultScope

string

既定で要求されるアクセス トークン スコープ。 API レベルでオーバーライドできます。 スペース区切りの値を含む文字列の形式で指定する必要があります。

properties.description

string

承認サーバーの説明。 HTML 書式設定タグを含めることができます。

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 が含まれています。

応答

名前 説明
200 OK

AuthorizationServerContract

承認サーバーは既に登録されています。

ヘッダー

ETag: string

201 Created

AuthorizationServerContract

承認サーバーが正常に登録されました。

ヘッダー

ETag: string

Other Status Codes

ErrorResponse

操作が失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー。

型: oauth2
フロー: implicit
Authorization URL (承認 URL): https://login.microsoftonline.com/common/oauth2/authorize

スコープ

名前 説明
user_impersonation ユーザー アカウントを偽装する

ApiManagementCreateAuthorizationServer

要求のサンプル

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

{
  "properties": {
    "displayName": "test2",
    "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",
    "clientSecret": "2",
    "resourceOwnerUsername": "un",
    "resourceOwnerPassword": "pwd"
  }
}

応答のサンプル

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer",
  "type": "Microsoft.ApiManagement/service/authorizationServers",
  "name": "newauthServer",
  "properties": {
    "displayName": "test2",
    "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/newauthServer",
  "type": "Microsoft.ApiManagement/service/authorizationServers",
  "name": "newauthServer",
  "properties": {
    "displayName": "test2",
    "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"
  }
}

定義

名前 説明
AuthorizationMethod

承認エンドポイントでサポートされている HTTP 動詞。 GET は常に存在する必要があります。 POST は省略可能です。

AuthorizationServerContract

外部 OAuth 承認サーバーの設定。

BearerTokenSendingMethod

アクセス トークンを API に渡すメカニズムを指定します。

ClientAuthenticationMethod

この承認サーバーのトークン エンドポイントでサポートされる認証方法。 使用できる値は Basic または Body です。 Body を指定すると、クライアント資格情報とその他のパラメーターが要求本文内でアプリケーション/x-www-form-urlencoded 形式で渡されます。

ErrorFieldContract

エラー フィールド コントラクト。

ErrorResponse

エラー応答。

GrantType

クライアントがアクセス トークンを要求するために使用する承認付与の形式。

TokenBodyParameterContract

OAuth 取得トークン要求本文パラメーター (www-url-form-encoded)。

AuthorizationMethod

承認エンドポイントでサポートされている HTTP 動詞。 GET は常に存在する必要があります。 POST は省略可能です。

説明
DELETE
GET
HEAD
OPTIONS
PATCH
POST
PUT
TRACE

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 を指定すると、クライアント資格情報とその他のパラメーターが要求本文内でアプリケーション/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

minLength: 1
maxLength: 50

ユーザー フレンドリな承認サーバー名。

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 が含まれています。

type

string

リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"

BearerTokenSendingMethod

アクセス トークンを API に渡すメカニズムを指定します。

説明
authorizationHeader
query

ClientAuthenticationMethod

この承認サーバーのトークン エンドポイントでサポートされる認証方法。 使用できる値は Basic または Body です。 Body を指定すると、クライアント資格情報とその他のパラメーターが要求本文内でアプリケーション/x-www-form-urlencoded 形式で渡されます。

説明
Basic

基本的なクライアント認証方法。

Body

本文ベースの認証方法。

ErrorFieldContract

エラー フィールド コントラクト。

名前 説明
code

string

プロパティ レベルのエラー コード。

message

string

プロパティ レベルエラーの人間が判読できる表現。

target

string

プロパティ名。

ErrorResponse

エラー応答。

名前 説明
error.code

string

サービス定義エラー コード。 このコードは、応答で指定された HTTP エラー コードのサブステータスとして機能します。

error.details

ErrorFieldContract[]

検証エラーが発生した場合に要求で送信される無効なフィールドの一覧。

error.message

string

エラーの人間が判読できる表現。

GrantType

クライアントがアクセス トークンを要求するために使用する承認付与の形式。

説明
authorizationCode

https://tools.ietf.org/html/rfc6749#section-4.1の説明に従って、承認コード付与フローを実行します。

clientCredentials

https://tools.ietf.org/html/rfc6749#section-4.4の説明に従って、クライアント資格情報付与フローを実行します。

implicit

https://tools.ietf.org/html/rfc6749#section-4.2の説明に従った暗黙的なコード付与フロー。

resourceOwnerPassword

https://tools.ietf.org/html/rfc6749#section-4.3説明されているように、リソース所有者パスワード付与フロー。

TokenBodyParameterContract

OAuth 取得トークン要求本文パラメーター (www-url-form-encoded)。

名前 説明
name

string

body パラメーター名。

value

string

body パラメーター値。