{
  "openapi": "3.0.0",
  "info": {
    "description": "Use these REST APIs for performing operations on Identity Provider entity associated with your Azure API Management deployment. Setting up an external Identity Provider for authentication can help you manage the developer portal logins using the OAuth2 flow.",
    "title": "ApiManagementClient",
    "version": "2018-01-01",
    "x-jentic-source-url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2018-01-01/apimidentityprovider.json"
  },
  "servers": [
    {
      "url": "https://management.azure.com/"
    }
  ],
  "paths": {
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders": {
      "get": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderList"
                }
              }
            },
            "description": "Lists a collection of Identity Providers."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProvider"
        ],
        "externalDocs": {
          "url": "https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-aad#how-to-authorize-developer-accounts-using-azure-active-directory"
        },
        "description": "Lists a collection of Identity Provider configured in the specified service instance.",
        "operationId": "IdentityProvider_ListByService",
        "x-ms-examples": {
          "ApiManagementListIdentityProviders": {
            "$ref": "./examples/ApiManagementListIdentityProviders.json"
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}": {
      "delete": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "#/components/parameters/IdentityProviderNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/IfMatchRequiredParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "The identity provider configuration was successfully deleted."
          },
          "204": {
            "description": "The identity provider configuration was successfully deleted."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProvider"
        ],
        "description": "Deletes the specified identity provider configuration.",
        "operationId": "IdentityProvider_Delete",
        "x-ms-examples": {
          "ApiManagementDeleteIdentityProvider": {
            "$ref": "./examples/ApiManagementDeleteIdentityProvider.json"
          }
        }
      },
      "get": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "#/components/parameters/IdentityProviderNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderContract"
                }
              }
            },
            "description": "The response body contains the specified IdentityProvider entity configuration details.",
            "headers": {
              "ETag": {
                "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProvider"
        ],
        "description": "Gets the configuration details of the identity Provider configured in specified service instance.",
        "operationId": "IdentityProvider_Get",
        "x-ms-examples": {
          "ApiManagementGetIdentityProvider": {
            "$ref": "./examples/ApiManagementGetIdentityProvider.json"
          }
        }
      },
      "head": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "#/components/parameters/IdentityProviderNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "Specified identity provider entity exists and current entity state version is present in the ETag header.",
            "headers": {
              "ETag": {
                "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProvider"
        ],
        "description": "Gets the entity state (Etag) version of the identityProvider specified by its identifier.",
        "operationId": "IdentityProvider_GetEntityTag",
        "x-ms-examples": {
          "ApiManagementHeadIdentityProvider": {
            "$ref": "./examples/ApiManagementHeadIdentityProvider.json"
          }
        }
      },
      "patch": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "#/components/parameters/IdentityProviderNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/IfMatchRequiredParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "204": {
            "description": "The existing identity provider configuration was successfully updated."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProviders"
        ],
        "description": "Updates an existing IdentityProvider configuration.",
        "operationId": "IdentityProvider_Update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityProviderUpdateParameters"
              }
            }
          },
          "description": "Update parameters.",
          "required": true
        },
        "x-ms-examples": {
          "ApiManagementUpdateIdentityProvider": {
            "$ref": "./examples/ApiManagementUpdateIdentityProvider.json"
          }
        }
      },
      "put": {
        "parameters": [
          {
            "$ref": "./apimanagement.json#/components/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ServiceNameParameter"
          },
          {
            "$ref": "#/components/parameters/IdentityProviderNameParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/IfMatchOptionalParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/ApiVersionParameter"
          },
          {
            "$ref": "./apimanagement.json#/components/parameters/SubscriptionIdParameter"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderContract"
                }
              }
            },
            "description": "The existing Identity Provider was successfully updated."
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityProviderContract"
                }
              }
            },
            "description": "IdentityProvider configuration were successfully created."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./apimanagement.json#/definitions/ErrorResponse"
                }
              }
            },
            "description": "Error response describing why the operation failed."
          }
        },
        "tags": [
          "IdentityProvider"
        ],
        "description": "Creates or Updates the IdentityProvider configuration.",
        "operationId": "IdentityProvider_CreateOrUpdate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityProviderContract"
              }
            }
          },
          "description": "Create parameters.",
          "required": true
        },
        "x-ms-examples": {
          "ApiManagementCreateIdentityProvider": {
            "$ref": "./examples/ApiManagementCreateIdentityProvider.json"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "IdentityProviderNameParameter": {
        "description": "Identity Provider Type identifier.",
        "in": "path",
        "name": "identityProviderName",
        "required": true,
        "schema": {
          "enum": [
            "facebook",
            "google",
            "microsoft",
            "twitter",
            "aad",
            "aadB2C"
          ],
          "type": "string"
        },
        "x-ms-enum": {
          "modelAsString": true,
          "name": "IdentityProviderType",
          "values": [
            {
              "description": "Facebook as Identity provider.",
              "value": "facebook"
            },
            {
              "description": "Google as Identity provider.",
              "value": "google"
            },
            {
              "description": "Microsoft Live as Identity provider.",
              "value": "microsoft"
            },
            {
              "description": "Twitter as Identity provider.",
              "value": "twitter"
            },
            {
              "description": "Azure Active Directory as Identity provider.",
              "value": "aad"
            },
            {
              "description": "Azure Active Directory B2C as Identity provider.",
              "value": "aadB2C"
            }
          ]
        },
        "x-ms-parameter-location": "method"
      }
    },
    "schemas": {
      "IdentityProviderBaseParameters": {
        "description": "Identity Provider Base Parameter Properties.",
        "properties": {
          "allowedTenants": {
            "description": "List of Allowed Tenants when configuring Azure Active Directory login.",
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "type": "array"
          },
          "passwordResetPolicyName": {
            "description": "Password Reset Policy Name. Only applies to AAD B2C Identity Provider.",
            "minLength": 1,
            "type": "string"
          },
          "profileEditingPolicyName": {
            "description": "Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.",
            "minLength": 1,
            "type": "string"
          },
          "signinPolicyName": {
            "description": "Signin Policy Name. Only applies to AAD B2C Identity Provider.",
            "minLength": 1,
            "type": "string"
          },
          "signupPolicyName": {
            "description": "Signup Policy Name. Only applies to AAD B2C Identity Provider.",
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "description": "Identity Provider Type identifier.",
            "enum": [
              "facebook",
              "google",
              "microsoft",
              "twitter",
              "aad",
              "aadB2C"
            ],
            "type": "string",
            "x-ms-enum": {
              "modelAsString": true,
              "name": "IdentityProviderType",
              "values": [
                {
                  "description": "Facebook as Identity provider.",
                  "value": "facebook"
                },
                {
                  "description": "Google as Identity provider.",
                  "value": "google"
                },
                {
                  "description": "Microsoft Live as Identity provider.",
                  "value": "microsoft"
                },
                {
                  "description": "Twitter as Identity provider.",
                  "value": "twitter"
                },
                {
                  "description": "Azure Active Directory as Identity provider.",
                  "value": "aad"
                },
                {
                  "description": "Azure Active Directory B2C as Identity provider.",
                  "value": "aadB2C"
                }
              ]
            }
          }
        },
        "type": "object"
      },
      "IdentityProviderContract": {
        "allOf": [
          {
            "$ref": "./apimanagement.json#/definitions/Resource"
          }
        ],
        "description": "Identity Provider details.",
        "properties": {
          "properties": {
            "$ref": "#/components/schemas/IdentityProviderContractProperties",
            "description": "Identity Provider contract properties.",
            "x-ms-client-flatten": true
          }
        },
        "type": "object"
      },
      "IdentityProviderContractProperties": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IdentityProviderBaseParameters"
          }
        ],
        "description": "The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management service developer portal for all users.",
        "properties": {
          "clientId": {
            "description": "Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.",
            "minLength": 1,
            "type": "string"
          },
          "clientSecret": {
            "description": "Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.",
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "clientId",
          "clientSecret"
        ],
        "type": "object"
      },
      "IdentityProviderList": {
        "description": "List of all the Identity Providers configured on the service instance.",
        "properties": {
          "nextLink": {
            "description": "Next page link if any.",
            "type": "string"
          },
          "value": {
            "description": "Identity Provider configuration values.",
            "items": {
              "$ref": "#/components/schemas/IdentityProviderContract"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "IdentityProviderUpdateParameters": {
        "description": "Parameters supplied to update Identity Provider",
        "properties": {
          "properties": {
            "$ref": "#/components/schemas/IdentityProviderUpdateProperties",
            "description": "Identity Provider update properties.",
            "x-ms-client-flatten": true
          }
        },
        "type": "object"
      },
      "IdentityProviderUpdateProperties": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IdentityProviderBaseParameters"
          }
        ],
        "description": "Parameters supplied to the Update Identity Provider operation.",
        "properties": {
          "clientId": {
            "description": "Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.",
            "minLength": 1,
            "type": "string"
          },
          "clientSecret": {
            "description": "Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.",
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "azure_auth": {
        "description": "Azure Active Directory OAuth2 Flow.",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
            "scopes": {
              "user_impersonation": "impersonate your user account"
            }
          }
        },
        "type": "oauth2"
      }
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ]
}