swagger: "2.0"
schemes:
  - https
host: management.azure.com
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: 2019-01-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2019-01-01/apimidentityprovider.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: apimanagement-apimidentityprovider
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow.
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders":
    get:
      description: Lists a collection of Identity Provider configured in the specified service instance.
      externalDocs:
        url: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-aad#how-to-authorize-developer-accounts-using-azure-active-directory
      operationId: IdentityProvider_ListByService
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Lists a collection of Identity Providers.
          schema:
            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:
                  allOf:
                    - description: The Resource definition.
                      properties:
                        id:
                          description: Resource ID.
                          readOnly: true
                          type: string
                        name:
                          description: Resource name.
                          readOnly: true
                          type: string
                        type:
                          description: Resource type for API Management resource.
                          readOnly: true
                          type: string
                      x-ms-azure-resource: true
                  description: Identity Provider details.
                  properties:
                    properties:
                      allOf:
                        - 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
                            authority:
                              description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                              type: string
                            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
                            signinTenant:
                              description: The TenantId to use instead of Common when logging into Active Directory
                              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
                      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: array
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementListIdentityProviders:
          parameters:
            api-version: 2019-01-01
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                nextLink: ""
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Google
                    name: Google
                    properties:
                      clientId: googleId
                      clientSecret: googlesecret
                      type: google
                    type: Microsoft.ApiManagement/service/identityProviders
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Aad
                    name: Aad
                    properties:
                      allowedTenants:
                        - samiraad.onmicrosoft.com
                      clientId: aadapplicationid
                      clientSecret: aadapplicationkey
                      type: aad
                    type: Microsoft.ApiManagement/service/identityProviders
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/AadB2C
                    name: AadB2C
                    properties:
                      allowedTenants:
                        - samirtestbc.onmicrosoft.com
                      clientId: aadb2clientId
                      clientSecret: aadb2cClientKey
                      signinPolicyName: B2C_1_Signin_Default
                      signupPolicyName: B2C_1_Signup_Default
                      type: aadB2C
                    type: Microsoft.ApiManagement/service/identityProviders
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}":
    delete:
      description: Deletes the specified identity provider configuration.
      operationId: IdentityProvider_Delete
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identity Provider Type identifier.
          enum:
            - facebook
            - google
            - microsoft
            - twitter
            - aad
            - aadB2C
          in: path
          name: identityProviderName
          required: true
          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
        - description: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
          in: header
          name: If-Match
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The identity provider configuration was successfully deleted.
        "204":
          description: The identity provider configuration was successfully deleted.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementDeleteIdentityProvider:
          parameters:
            If-Match: "*"
            api-version: 2019-01-01
            identityProviderName: aad
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets the configuration details of the identity Provider configured in specified service instance.
      operationId: IdentityProvider_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identity Provider Type identifier.
          enum:
            - facebook
            - google
            - microsoft
            - twitter
            - aad
            - aadB2C
          in: path
          name: identityProviderName
          required: true
          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
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          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.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Identity Provider details.
            properties:
              properties:
                allOf:
                  - 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
                      authority:
                        description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                        type: string
                      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
                      signinTenant:
                        description: The TenantId to use instead of Common when logging into Active Directory
                        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
                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
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementGetIdentityProvider:
          parameters:
            api-version: 2019-01-01
            identityProviderName: aadB2C
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/AadB2C
                name: AadB2C
                properties:
                  allowedTenants:
                    - contosoaadb2c.onmicrosoft.com
                    - contoso2aadb2c.onmicrosoft.com
                  authority: login.microsoftonline.com
                  clientId: f02dafe2-b8b8-48ec-a38e-27e5c16c51e5
                  clientSecret: XXXXXXX
                  signinPolicyName: B2C_1_policy-signin
                  signinTenant: contosoaadb2c.onmicrosoft.com
                  signupPolicyName: B2C_1_policy-signup
                  type: aadB2C
                type: Microsoft.ApiManagement/service/identityProviders
    head:
      description: Gets the entity state (Etag) version of the identityProvider specified by its identifier.
      operationId: IdentityProvider_GetEntityTag
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identity Provider Type identifier.
          enum:
            - facebook
            - google
            - microsoft
            - twitter
            - aad
            - aadB2C
          in: path
          name: identityProviderName
          required: true
          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
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      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.
              type: string
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementHeadIdentityProvider:
          parameters:
            api-version: 2019-01-01
            identityProviderName: aadB2C
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              headers:
                etag: AAAAAAAAAAa=
    patch:
      description: Updates an existing IdentityProvider configuration.
      operationId: IdentityProvider_Update
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identity Provider Type identifier.
          enum:
            - facebook
            - google
            - microsoft
            - twitter
            - aad
            - aadB2C
          in: path
          name: identityProviderName
          required: true
          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
        - description: Update parameters.
          in: body
          name: parameters
          required: true
          schema:
            description: Parameters supplied to update Identity Provider
            properties:
              properties:
                allOf:
                  - 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
                      authority:
                        description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                        type: string
                      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
                      signinTenant:
                        description: The TenantId to use instead of Common when logging into Active Directory
                        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
                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
        - description: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
          in: header
          name: If-Match
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "204":
          description: The existing identity provider configuration was successfully updated.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementUpdateIdentityProvider:
          parameters:
            If-Match: "*"
            api-version: 2019-01-01
            identityProviderName: facebook
            parameters:
              properties:
                clientId: updatedfacebookid
                clientSecret: updatedfacebooksecret
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "204": {}
    put:
      description: Creates or Updates the IdentityProvider configuration.
      operationId: IdentityProvider_CreateOrUpdate
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identity Provider Type identifier.
          enum:
            - facebook
            - google
            - microsoft
            - twitter
            - aad
            - aadB2C
          in: path
          name: identityProviderName
          required: true
          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
        - description: Create parameters.
          in: body
          name: parameters
          required: true
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Identity Provider details.
            properties:
              properties:
                allOf:
                  - 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
                      authority:
                        description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                        type: string
                      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
                      signinTenant:
                        description: The TenantId to use instead of Common when logging into Active Directory
                        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
                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
        - description: ETag of the Entity. Not required when creating an entity, but required when updating an entity.
          in: header
          name: If-Match
          required: false
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The existing Identity Provider was successfully updated.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Identity Provider details.
            properties:
              properties:
                allOf:
                  - 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
                      authority:
                        description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                        type: string
                      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
                      signinTenant:
                        description: The TenantId to use instead of Common when logging into Active Directory
                        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
                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
        "201":
          description: IdentityProvider configuration were successfully created.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Identity Provider details.
            properties:
              properties:
                allOf:
                  - 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
                      authority:
                        description: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
                        type: string
                      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
                      signinTenant:
                        description: The TenantId to use instead of Common when logging into Active Directory
                        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
                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
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - IdentityProvider
      x-ms-examples:
        ApiManagementCreateIdentityProvider:
          parameters:
            api-version: 2019-01-01
            identityProviderName: facebook
            parameters:
              properties:
                clientId: facebookid
                clientSecret: facebookapplicationsecret
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Facebook
                name: Facebook
                properties:
                  clientId: facebookid
                  clientSecret: facebookapplicationsecret
                  type: facebook
                type: Microsoft.ApiManagement/service/identityProviders
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Facebook
                name: Facebook
                properties:
                  clientId: facebookid
                  clientSecret: facebookapplicationsecret
                  type: facebook
                type: Microsoft.ApiManagement/service/identityProviders
definitions: {}
