---
title: "Upsert an application auth strategy"
url: "https://nov18-dev.movespot.fyi/apis/internal-api-builder-v1-1/versions/37dd8750-3a87-4f5b-aa5c-d7d8aa14eea8/operations/put-app-auth-strategy"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/internal-api-builder-v1-1/versions/37dd8750-3a87-4f5b-aa5c-d7d8aa14eea8.md

# Upsert an application auth strategy

`PUT` `/internal/application-auth-strategies/{authStrategyId}`

Operation ID: `put-app-auth-strategy`

Accepts a raw database representation of the Auth Strategy in the request body. Accepts a raw database representation of the DCR provider (if provided) in the response body.

## Path parameters

- `authStrategyId` (string, uuid, required) - ID of the auth strategy to use for the application

## Request body (required)

Content types: `application/json`

## Responses

- `200` - A response containing a single DCR provider object.
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Internal API-Builder v1
  version: 1.0.13
servers:
  - url: builder.apibuilder.svc.cluster.local:3000/v1
    description: Konnect cluster
paths:
  /internal/application-auth-strategies/{authStrategyId}:
    parameters:
      - $ref: "#/components/parameters/AuthStrategyId"
    put:
      operationId: put-app-auth-strategy
      summary: Upsert an application auth strategy
      description: >
        Accepts a raw database representation of the Auth Strategy in the
        request body.

        Accepts a raw database representation of the DCR provider (if provided)
        in the response body.
      requestBody:
        $ref: "#/components/requestBodies/PutAppAuthStrategy"
      responses:
        "200":
          $ref: "#/components/responses/PutAppAuthStrategyResponse"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      tags:
        - App Auth Strategies
components:
  parameters:
    AuthStrategyId:
      name: authStrategyId
      description: ID of the auth strategy to use for the application
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: ebbac5b0-ac89-45c3-9d2e-c4542c657e79
  requestBodies:
    PutAppAuthStrategy:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AppAuthStrategy"
          examples:
            PutAppAuthStrategy:
              $ref: "#/components/examples/AppAuthStrategyRequest"
  responses:
    PutAppAuthStrategyResponse:
      description: A response containing a single DCR provider object.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AppAuthStrategy"
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/UnauthorizedExample"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/ForbiddenExample"
  schemas:
    AppAuthStrategy:
      description: A set of plugin configurations that represent how the gateway will
        perform authentication and authorization for a Product Version. Called
        “Auth Strategy” for short in the context of portals/applications. The
        plugins are synced to any Gateway Service that is currently linked or
        becomes linked to the Product Version.
      type: object
      discriminator:
        propertyName: strategy_type
      oneOf:
        - $ref: "#/components/schemas/AppAuthStrategyKeyAuth"
        - $ref: "#/components/schemas/AppAuthStrategyOpenIDConnect"
      title: AppAuthStrategy
    BadRequestError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          required:
            - invalid_parameters
          properties:
            invalid_parameters:
              $ref: "#/components/schemas/InvalidParameters"
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 401
            title:
              example: Unauthorized
            type:
              example: https://httpstatuses.com/401
            instance:
              example: kong:trace:1234567890
            detail:
              example: Invalid credentials
    ForbiddenError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 403
            title:
              example: Forbidden
            type:
              example: https://httpstatuses.com/403
            instance:
              example: kong:trace:1234567890
            detail:
              example: Forbidden
    AppAuthStrategyKeyAuth:
      description: Response payload from creating or updating a Key Auth Application
        Auth Strategy
      type: object
      properties:
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        name:
          description: >
            The name of the auth strategy. This is used to identify the auth
            strategy in the Konnect UI.
          type: string
          maxLength: 256
          minLength: 1
        display_name:
          description: >
            The display name of the Auth strategy. This is used to identify the
            Auth strategy in the Portal UI.
          type: string
          maxLength: 256
        strategy_type:
          type: string
          enum:
            - key_auth
        configs:
          description: JSON-B object containing the configuration for the Key Auth strategy
          type: object
          additionalProperties: false
          properties:
            key-auth:
              $ref: "#/components/schemas/AppAuthStrategyConfigKeyAuth"
          required:
            - key-auth
        labels:
          $ref: "#/components/schemas/LabelsUpdate"
        dcr_provider:
          $ref: "#/components/schemas/DcrProvider"
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      additionalProperties: false
      required:
        - id
        - name
        - display_name
        - strategy_type
        - org_id
        - configs
        - labels
        - created_at
        - updated_at
      title: AppAuthStrategyKeyAuthResponse
    AppAuthStrategyOpenIDConnect:
      description: Response payload from creating an OIDC Application Auth Strategy
      type: object
      properties:
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        name:
          description: |
            The name of the app auth strategy.
          type: string
          maxLength: 256
          minLength: 1
        display_name:
          description: >
            The display name of the Auth strategy. This is used to identify the
            Auth strategy in the Portal UI.
          type: string
          maxLength: 256
        strategy_type:
          description: The stategy type. Can be either openid_connect or key_auth.
          type: string
          enum:
            - openid_connect
        configs:
          description: JSON-B object containing the configuration for the OIDC strategy
          type: object
          additionalProperties: false
          properties:
            openid-connect:
              $ref: "#/components/schemas/AppAuthStrategyConfigOpenIDConnect"
          required:
            - openid-connect
        dcr_provider:
          $ref: "#/components/schemas/DcrProvider"
        labels:
          $ref: "#/components/schemas/Labels"
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      additionalProperties: false
      required:
        - id
        - name
        - display_name
        - strategy_type
        - org_id
        - configs
        - labels
        - created_at
        - updated_at
      title: AppAuthStrategyOpenIDConnectResponse
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
    InvalidParameters:
      description: invalid parameters
      type: array
      items:
        oneOf:
          - $ref: "#/components/schemas/InvalidParameterStandard"
          - $ref: "#/components/schemas/InvalidParameterMinimumLength"
          - $ref: "#/components/schemas/InvalidParameterMaximumLength"
          - $ref: "#/components/schemas/InvalidParameterChoiceItem"
          - $ref: "#/components/schemas/InvalidParameterDependentItem"
      minItems: 1
      nullable: false
      uniqueItems: true
    AppAuthStrategyConfigKeyAuth:
      description: >
        The most basic mode to configure an Application Auth Strategy for an API
        Product Version. 

        Using this mode will allow developers to generate API keys that will
        authenticate their application requests. 

        Once authenticated, an application will be granted access to any Product
        Version it is registered for that is configured for Key Auth.
      type: object
      properties:
        key_names:
          description: The names of the headers containing the API key. You can specify
            multiple header names.
          type: array
          items:
            type: string
            maxLength: 256
          maxItems: 10
          minItems: 1
        ttl:
          description: Default maximum Time-To-Live for keys created under this strategy.
          type: object
          properties:
            value:
              type: integer
              minimum: 1
            unit:
              type: string
              enum:
                - days
                - weeks
                - years
          required:
            - value
            - unit
      additionalProperties: false
      title: AppAuthStrategyConfigKeyAuth
    LabelsUpdate:
      description: >
        Labels store metadata of an entity that can be used for filtering an
        entity list or for searching across entity types. 


        Labels are intended to store **INTERNAL** metadata.


        Keys must be of length 1-63 characters, and cannot start with "kong",
        "konnect", "mesh", "kic", or "_".
      type: object
      example:
        env: test
      additionalProperties:
        type: string
        pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$
        minLength: 1
        maxLength: 63
        nullable: true
      maxProperties: 50
      nullable: true
      writeOnly: true
    DcrProvider:
      type: object
      properties:
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        name:
          $ref: "#/components/schemas/DcrProviderName"
        provider_type:
          description: The type of DCR provider. Can be one of the following - auth0,
            azureAd, curity, okta, http, kongIdentity
          type: string
          enum:
            - auth0
            - azureAd
            - curity
            - okta
            - http
            - kongIdentity
        issuer:
          type: string
          format: url
          maxLength: 256
        labels:
          $ref: "#/components/schemas/LabelsUpdate"
        dcr_config:
          anyOf:
            - $ref: "#/components/schemas/UpdateDcrConfigAuth0InRequest"
            - $ref: "#/components/schemas/UpdateDcrConfigAzureAdInRequest"
            - $ref: "#/components/schemas/UpdateDcrConfigCurityInRequest"
            - $ref: "#/components/schemas/UpdateDcrConfigOktaInRequest"
            - $ref: "#/components/schemas/UpdateDcrConfigHttpInRequest"
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
        - provider_type
        - issuer
        - dcr_config
        - org_id
        - created_at
        - updated_at
      title: DcrProvider
    AppAuthStrategyConfigOpenIDConnect:
      description: >
        A more advanced mode to configure an API Product Version’s Application
        Auth Strategy. 

        Using this mode will allow developers to use API credentials issued from
        an external IdP that will authenticate their application requests. 

        Once authenticated, an application will be granted access to any Product
        Version it is registered for that is configured for the same Auth
        Strategy. 

        An OIDC strategy may be used in conjunction with a DCR provider to
        automatically create the IdP application.
      type: object
      properties:
        issuer:
          type: string
          format: url
          maxLength: 256
        credential_claim:
          type: array
          items:
            type: string
            maxLength: 128
          maxItems: 10
        scopes:
          type: array
          items:
            type: string
            maxLength: 128
          maxItems: 50
        auth_methods:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 10
      additionalProperties: true
      required:
        - issuer
        - credential_claim
        - scopes
        - auth_methods
      title: AppAuthStrategyConfigOpenIDConnect
    Labels:
      description: >
        Labels store metadata of an entity that can be used for filtering an
        entity list or for searching across entity types. 


        Keys must be of length 1-63 characters, and cannot start with "kong",
        "konnect", "mesh", "kic", or "_".
      type: object
      example:
        env: test
      additionalProperties:
        type: string
        pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$
        minLength: 1
        maxLength: 63
      maxProperties: 50
      title: Labels
    InvalidParameterStandard:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          $ref: "#/components/schemas/InvalidRules"
        source:
          type: string
          example: body
        reason:
          type: string
          example: is a required field
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
    InvalidParameterMinimumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - min_length
            - min_digits
            - min_lowercase
            - min_uppercase
            - min_symbols
            - min_items
            - min
          nullable: false
          readOnly: true
        minimum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must have at least 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - minimum
    InvalidParameterMaximumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - max_length
            - max_items
            - max
          nullable: false
          readOnly: true
        maximum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must not have more than 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - maximum
    InvalidParameterChoiceItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - enum
          nullable: false
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        choices:
          type: array
          items: {}
          minItems: 1
          nullable: false
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - choices
    InvalidParameterDependentItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - dependent_fields
          nullable: true
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        dependents:
          type: array
          items: {}
          nullable: true
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - rule
        - reason
        - dependents
    DcrProviderName:
      description: >
        The name of the DCR provider. This is used to identify the DCR provider
        in the Konnect UI.
      type: string
      maxLength: 256
      minLength: 1
    UpdateDcrConfigAuth0InRequest:
      description: Payload to update an Auth0 DCR provider.
      type: object
      properties:
        initial_client_id:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientId"
        initial_client_secret:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientSecret"
        initial_client_audience:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientAudience"
        use_developer_managed_scopes:
          type: boolean
      additionalProperties: false
      title: DcrConfigAuth0InRequest
    UpdateDcrConfigAzureAdInRequest:
      description: Payload to update an Azure AD DCR provider.
      type: object
      properties:
        initial_client_id:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientId"
        initial_client_secret:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientSecret"
      additionalProperties: false
      title: DcrConfigAzureAdInRequest
    UpdateDcrConfigCurityInRequest:
      description: Payload to update a Curity DCR provider.
      type: object
      properties:
        initial_client_id:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientId"
        initial_client_secret:
          $ref: "#/components/schemas/DcrConfigPropertyInitialClientSecret"
      additionalProperties: false
      title: DcrConfigCurityInRequest
    UpdateDcrConfigOktaInRequest:
      description: Payload to update an Okta DCR provider.
      type: object
      properties:
        dcr_token:
          $ref: "#/components/schemas/DcrConfigPropertyDcrToken"
      additionalProperties: false
      title: DcrConfigOktaInRequest
    UpdateDcrConfigHttpInRequest:
      description: Payload to update an HTTP DCR provider.
      type: object
      properties:
        dcr_base_url:
          $ref: "#/components/schemas/DcrBaseUrl"
        api_key:
          $ref: "#/components/schemas/DcrConfigPropertyApiKey"
        disable_event_hooks:
          $ref: "#/components/schemas/DcrConfigPropertyDisableEventHooks"
        disable_refresh_secret:
          $ref: "#/components/schemas/DcrConfigPropertyDisableRefreshSecret"
        allow_multiple_credentials:
          $ref: "#/components/schemas/DcrConfigPropertyAllowMultipleCredentials"
      additionalProperties: false
      title: CreateDcrConfigHttpInRequest
    InvalidRules:
      description: invalid parameters rules
      type: string
      enum:
        - required
        - is_array
        - is_base64
        - is_boolean
        - is_date_time
        - is_integer
        - is_null
        - is_number
        - is_object
        - is_string
        - is_uuid
        - is_fqdn
        - is_arn
        - unknown_property
        - missing_reference
        - is_label
        - matches_regex
        - invalid
        - is_supported_network_availability_zone_list
        - is_supported_network_cidr_block
        - is_supported_provider_region
        - type
      nullable: true
      readOnly: true
    DcrConfigPropertyInitialClientId:
      description: >
        This ID should be copied from your identity provider's settings after
        you create a client

        and assign it as the management client for DCR for this developer portal
      type: string
      maxLength: 256
      title: DcrConfigPropertyInitialClientId
    DcrConfigPropertyInitialClientSecret:
      description: >
        This secret should be copied from your identity provider's settings
        after you create a client

        and assign it as the management client for DCR for this developer portal
      type: string
      title: DcrConfigPropertyInitialClientSecret
    DcrConfigPropertyInitialClientAudience:
      description: >
        This is the audience value used for the initial client.

        If using a custom domain on Auth0, this must be set as to the Auth0
        Management API audience value.

        If left blank, the issuer will be used instead.
      type: string
      maxLength: 256
      nullable: true
      title: DcrConfigPropertyInitialClientAudience
    DcrConfigPropertyDcrToken:
      description: >
        This secret should be copied from your identity provider's settings
        after you create a client

        and assign it as the management client for DCR for this developer portal
      type: string
      title: DcrConfigPropertyInitialDcrToken
    DcrBaseUrl:
      description: >
        The base URL of the DCR server. This is the URL that will be used to
        make the HTTP requests from Konnect to the DCR provider.

        This URL must be accessible from the Konnect service.
      type: string
      format: url
      maxLength: 256
    DcrConfigPropertyApiKey:
      description: >
        This is the API Key that will be sent with each HTTP request to the
        custom DCR server. It can be

        verified on the server to ensure that incoming requests are coming from
        Konnect.
      type: string
      title: DcrConfigPropertyApiKey
    DcrConfigPropertyDisableEventHooks:
      description: This flag disables all the event-hooks on the application flow for
        the DCR provider.
      type: boolean
      title: DcrConfigPropertyDisableEventHooks
    DcrConfigPropertyDisableRefreshSecret:
      description: This flag disable the refresh-secret endpoint on the application
        flow for the DCR provider.
      type: boolean
      title: DcrConfigPropertyDisableRefreshSecret
    DcrConfigPropertyAllowMultipleCredentials:
      description: When enabled, indicates that the DCR provider supports creating and
        managing multiple credentials per application.
      type: boolean
      default: false
      title: DcrConfigPropertyAllowMultipleCredentials
  examples:
    AppAuthStrategyRequest:
      summary: Application auth strategy request example
      value:
        id: 93f8380e-7798-4566-99e3-2edf2b57d289
        name: strategy
        display_name: strategy display name
        strategy_type: key_auth
        org_id: 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7
        labels: {}
        configs:
          key-auth:
            key_names:
              - secret
        created_at: 2023-01-01T00:00:00.000Z
        updated_at: 2023-01-01T00:00:00.000Z
        dcr_provider:
          id: 93f8380e-7798-4566-99e3-2edf2b57d289
          name: DCR Auth0 1 - Segment A
          provider_type: auth0
          issuer: https://my-issuer.auth0.com/api/v2/
          dcr_config:
            initial_client_id: abc123
            initial_client_audience: https://my-custom-domain.com/api/v2/
            use_developer_managed_scopes: false
          org_id: 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7
          labels: {}
          created_at: 2023-01-01T00:00:00.000Z
          updated_at: 2023-01-01T00:00:00.000Z
    UnauthorizedExample:
      value:
        status: 401
        title: Unauthorized
        instance: kong:trace:8347343766220159418
        detail: Unauthorized
    ForbiddenExample:
      value:
        status: 403
        title: Forbidden
        instance: kong:trace:2723154947768991354
        detail: You do not have permission to perform this action
```
