{ "swagger": "2.0", "info": { "title": "ApiManagementClient", "description": "Use these REST APIs for managing OAuth2 servers configuration in your Azure API Management deployment. OAuth 2.0 can be used to authorize developer accounts for Azure API Management. For more information refer to [How to OAuth2](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-oauth2).", "version": "2016-10-10" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers": { "get": { "tags": [ "AuthorizationServers" ], "operationId": "AuthorizationServers_ListByService", "description": "Lists a collection of authorization servers defined within a service instance.", "externalDocs": { "url": "https://msdn.microsoft.com/en-us/library/azure/dn879064.aspx" }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|-------|------------------------|---------------------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "A Collection of the Authorization Server entities for the specified API Management service instance.", "schema": { "$ref": "#/definitions/AuthorizationServerCollection" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/OAuth2AuthorizationServerContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}": { "get": { "tags": [ "AuthorizationServers" ], "operationId": "AuthorizationServers_Get", "description": "Gets the details of the authorization server specified by its identifier.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/AuthenticationServerIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Gets the details of the specified authorization server.", "schema": { "$ref": "#/definitions/OAuth2AuthorizationServerContract" }, "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "put": { "tags": [ "AuthorizationServers" ], "operationId": "AuthorizationServers_CreateOrUpdate", "description": "Creates new authorization server or updates an existing authorization server.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/AuthenticationServerIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/OAuth2AuthorizationServerContract" }, "description": "Create or update parameters." }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Authorization server was successfully registered." }, "204": { "description": "Authorization server is already registered." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "patch": { "tags": [ "AuthorizationServers" ], "operationId": "AuthorizationServers_Update", "description": "Updates the details of the authorization server specified by its identifier.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/AuthenticationServerIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/OAuth2AuthorizationServerUpdateContract" }, "description": "OAuth2 Server settings Update parameters." }, { "name": "If-Match", "in": "header", "required": true, "description": "The entity state (Etag) version of the authorization server to update. A value of \"*\" can be used for If-Match to unconditionally apply the operation.", "type": "string" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "The authorization server settings were successfully updated." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } }, "delete": { "tags": [ "AuthorizationServers" ], "operationId": "AuthorizationServers_Delete", "description": "Deletes specific authorization server instance.", "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/AuthenticationServerIdParameter" }, { "name": "If-Match", "in": "header", "required": true, "description": "The entity state (Etag) version of the authentication server to delete. A value of \"*\" can be used for If-Match to unconditionally apply the operation.", "type": "string" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "The authorization server settings were successfully deleted." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorBodyContract" } } } } } }, "definitions": { "AuthorizationServerCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/OAuth2AuthorizationServerContract" }, "description": "Page values." }, "count": { "type": "integer", "format": "int64", "description": "Total record count number across all pages." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "Paged OAuth2 Authorization Servers list representation." }, "OAuth2AuthorizationServerContract": { "properties": { "id": { "readOnly": true, "type": "string", "description": "Uniquely identifies the authorization server within the current API Management service instance. The value is a valid relative URL in the format of /authorizationServers/{authsid} where {authsid} is an authorization server identifier." }, "name": { "type": "string", "description": "User-friendly authorization server name.", "minLength": 1, "maxLength": 50 }, "description": { "type": "string", "description": "Description of the authorization server. Can contain HTML formatting tags." }, "clientRegistrationEndpoint": { "type": "string", "description": "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced." }, "authorizationEndpoint": { "type": "string", "description": "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2." }, "authorizationMethods": { "type": "array", "items": { "type": "string", "enum": [ "HEAD", "OPTIONS", "TRACE", "GET", "POST", "PUT", "PATCH", "DELETE" ], "x-ms-enum": { "name": "MethodContract", "modelAsString": false } }, "description": "HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional." }, "clientAuthenticationMethod": { "type": "array", "items": { "type": "string", "enum": [ "Basic", "Body" ], "x-ms-enum": { "name": "ClientAuthenticationMethodContract", "modelAsString": false } }, "description": "Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format." }, "tokenBodyParameters": { "type": "array", "items": { "$ref": "#/definitions/TokenBodyParameterContract" }, "description": "Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {\"name\" : \"name value\", \"value\": \"a value\"}." }, "tokenEndpoint": { "type": "string", "description": "OAuth token endpoint. Contains absolute URI to entity being referenced.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.1" } }, "supportState": { "type": "boolean", "description": "If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.1" } }, "defaultScope": { "type": "string", "description": "Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.3" } }, "grantTypes": { "type": "array", "items": { "type": "string", "enum": [ "authorizationCode", "implicit", "resourceOwnerPassword", "clientCredentials" ], "x-ms-enum": { "name": "GrantTypesContract", "modelAsString": false } }, "description": "Form of an authorization grant, which the client uses to request the access token.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-4" } }, "bearerTokenSendingMethods": { "type": "array", "items": { "type": "string", "enum": [ "authorizationHeader", "query" ], "x-ms-enum": { "name": "BearerTokenSendingMethodsContract", "modelAsString": false } }, "description": "Specifies the mechanism by which access token is passed to the API. ", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-4" } }, "clientId": { "type": "string", "description": "Client or app id registered with this authorization server." }, "clientSecret": { "type": "string", "description": "Client or app secret registered with this authorization server." }, "resourceOwnerUsername": { "type": "string", "description": "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username." }, "resourceOwnerPassword": { "type": "string", "description": "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password." } }, "required": [ "name", "clientRegistrationEndpoint", "authorizationEndpoint", "clientId", "grantTypes" ], "description": "External OAuth authorization server settings." }, "OAuth2AuthorizationServerUpdateContract": { "properties": { "name": { "type": "string", "description": "User-friendly authorization server name.", "minLength": 1, "maxLength": 50 }, "description": { "type": "string", "description": "Description of the authorization server. Can contain HTML formatting tags." }, "clientRegistrationEndpoint": { "type": "string", "description": "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced." }, "authorizationEndpoint": { "type": "string", "description": "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2." }, "authorizationMethods": { "type": "array", "items": { "type": "string", "enum": [ "HEAD", "OPTIONS", "TRACE", "GET", "POST", "PUT", "PATCH", "DELETE" ], "x-ms-enum": { "name": "MethodContract", "modelAsString": false } }, "description": "HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional." }, "clientAuthenticationMethod": { "type": "array", "items": { "type": "string", "enum": [ "Basic", "Body" ], "x-ms-enum": { "name": "ClientAuthenticationMethodContract", "modelAsString": false } }, "description": "Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format." }, "tokenBodyParameters": { "type": "array", "items": { "$ref": "#/definitions/TokenBodyParameterContract" }, "description": "Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {\"name\" : \"name value\", \"value\": \"a value\"}." }, "tokenEndpoint": { "type": "string", "description": "OAuth token endpoint. Contains absolute URI to entity being referenced.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.1" } }, "supportState": { "type": "boolean", "description": "If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.1" } }, "defaultScope": { "type": "string", "description": "Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-3.3" } }, "grantTypes": { "type": "array", "items": { "type": "string", "enum": [ "authorizationCode", "implicit", "resourceOwnerPassword", "clientCredentials" ], "x-ms-enum": { "name": "GrantTypesContract", "modelAsString": false } }, "description": "Form of an authorization grant, which the client uses to request the access token.", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-4" } }, "bearerTokenSendingMethods": { "type": "array", "items": { "type": "string", "enum": [ "authorizationHeader", "query" ], "x-ms-enum": { "name": "BearerTokenSendingMethodsContract", "modelAsString": false } }, "description": "Specifies the mechanism by which access token is passed to the API. ", "externalDocs": { "url": "http://tools.ietf.org/html/rfc6749#section-4" } }, "clientId": { "type": "string", "description": "Client or app id registered with this authorization server." }, "clientSecret": { "type": "string", "description": "Client or app secret registered with this authorization server." }, "resourceOwnerUsername": { "type": "string", "description": "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username." }, "resourceOwnerPassword": { "type": "string", "description": "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password." } }, "description": "External OAuth authorization server Update settings contract." }, "TokenBodyParameterContract": { "properties": { "name": { "type": "string", "description": "body parameter name." }, "value": { "type": "string", "description": "body parameter value." } }, "required": [ "name", "value" ], "description": "OAuth acquire token request body parameter (www-url-form-encoded)." } }, "parameters": { "AuthenticationServerIdParameter": { "name": "authsid", "in": "path", "required": true, "type": "string", "description": "Identifier of the authorization server.", "maxLength": 256, "pattern": "^[^*#&+:<>?]+$", "x-ms-parameter-location": "method" } } }