> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set VPN gateway authentication

> POST /v2/api/set_vpn_gateway_authentication



## OpenAPI

````yaml /openapi/10.0/aviatrix-api.json post /v2/api/set_vpn_gateway_authentication
openapi: 3.1.0
info:
  title: Aviatrix Controller API
  version: '10.0'
  description: >-
    Aviatrix Controller API — version 10.0. Selected operations with Mintlify
    metadata.
servers: []
security: []
tags:
  - name: policies
    x-group: Policies
  - name: authentication
    x-group: Authentication
  - name: account-management
    x-group: Account Management
  - name: rbac
    x-group: RBAC & Permissions
  - name: gateways
    x-group: Gateways
  - name: transit
    x-group: Transit
  - name: nat
    x-group: NAT
  - name: app-domains
    x-group: SmartGroups
  - name: certificates
    x-group: Certificates
  - name: mitm
    x-group: MITM
  - name: monitoring
    x-group: Monitoring & Diagnostics
  - name: fqdn
    x-group: FQDN
  - name: logging
    x-group: Logging
  - name: vpn
    x-group: UserVPN
  - name: site-to-cloud
    x-group: Site-to-Cloud
  - name: controller
    x-group: Controller
  - name: bgp
    x-group: BGP
  - name: general
    x-group: General
  - name: firenet
    x-group: FireNet
  - name: networking
    x-group: Networking
  - name: tgw
    x-group: AWS TGW
  - name: ips
    x-group: IPS
  - name: saml
    x-group: SAML
paths:
  /v2/api/set_vpn_gateway_authentication:
    post:
      tags:
        - vpn
      operationId: set_vpn_gateway_authentication
      requestBody:
        content:
          application/json:
            schema:
              properties:
                CID:
                  $ref: '#/components/schemas/CID'
                action:
                  $ref: '#/components/schemas/action'
                auth_type:
                  description: Authentication type.
                  enum:
                    - duo_auth
                    - duo_ldap_auth
                    - ldap_auth
                    - none
                    - okta_auth
                    - saml_auth
                  type: string
                dns:
                  description: Modifying a DNS.
                  type: boolean
                duo_api_hostname:
                  description: API hostname.
                  type: string
                duo_integration_key:
                  description: Duo integration key.
                  type: string
                duo_push_mode:
                  description: Duo push mode.
                  enum:
                    - auto
                    - selective
                    - token
                  type: string
                duo_secret_key:
                  description: Duo secret key.
                  type: string
                enable_ldap:
                  description: Enable LDAP authentication.
                  type: boolean
                lb_name:
                  description: Load balancer name.
                  type: string
                ldap_additional_ladp_req:
                  description: Additional requirements.
                  type: string
                ldap_base_dn:
                  description: Base DN for User entries.
                  type: string
                ldap_bind_dn:
                  description: Bind DN.
                  type: string
                ldap_ca_cert:
                  description: |-
                    CA cert in PEM format.
                    This field must be base64 encoded.
                  type: string
                ldap_client_cert:
                  description: |-
                    Client cert in PEM format.
                    This field must be base64 encoded.
                  type: string
                ldap_enable_tls:
                  $ref: '#/components/schemas/StringToggle'
                  description: Enable TLS authentication.
                ldap_password:
                  description: Bind DN password.
                  type: string
                ldap_server:
                  description: LDAP server address.
                  type: string
                ldap_user:
                  description: LDAP user.
                  type: string
                ldap_username_attribute:
                  description: Username attribute.
                  type: string
                okta_token:
                  description: Token for API access.
                  type: string
                okta_url:
                  description: Okta URL.
                  type: string
                okta_username_suffix:
                  description: Token for API access.
                  type: string
                vpc_id:
                  description: VPC_ID.
                  type: string
              required:
                - vpc_id
                - lb_name
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/general_response_v2'
        default:
          $ref: '#/components/responses/general_response_v2'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -sk -X POST
            "https://<controller>/v2/api/set_vpn_gateway_authentication" \
              -H "Authorization: cid <CID>"
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://<controller>/v2/api/set_vpn_gateway_authentication"
            headers = {"Authorization": "cid <CID>"}

            response = requests.post(url, headers=headers, verify=False)
            print(response.status_code)
            print(response.text)
        - lang: javascript
          label: JavaScript
          source: >-
            fetch("https://<controller>/v2/api/set_vpn_gateway_authentication",
            {
              method: "POST",
              headers: {"Authorization": "cid <CID>"}
            })
              .then(res => res.text())
              .then(console.log)
              .catch(console.error);
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
            )

            func main() {
              req, _ := http.NewRequest("POST", "https://<controller>/v2/api/set_vpn_gateway_authentication", nil)
              req.Header.Set("Authorization", "cid <CID>")

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              fmt.Println(resp.Status)
            }
components:
  schemas:
    CID:
      description: The opaque session ID token. Required for 7.2 controllers only.
      type: string
    action:
      description: The API action to perform. Required for 7.2 controllers only.
      type: string
    StringToggle:
      description: A boolean choice expressed as a string
      enum:
        - 'yes'
        - 'no'
      type: string
    general_response_v2:
      additionalProperties: true
      description: A generic API response container for v2 style APIs.
      properties:
        errortype:
          description: Error type if the API failed.
          type: string
        reason:
          description: Failure reason if the API failed.
          type: string
        results:
          oneOf:
            - description: API response data
              type: boolean
            - description: API response data
              type: integer
            - description: API response data
              type: string
            - description: API response data
              type: object
            - description: API response data
              items: {}
              type: array
        return:
          description: Whether the API returned successfully
          type: boolean
      title: General Response v2
      type: object
  responses:
    general_response_v2:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/general_response_v2'
      description: General v2 API response schema.

````