---
title: "POST /api/v1/auth/ldap-auth/identities/{identityId}"
method: POST
path: "/api/v1/auth/ldap-auth/identities/{identityId}"
tags: ["LDAP Auth"]
---

# POST /api/v1/auth/ldap-auth/identities/{identityId}

`POST /api/v1/auth/ldap-auth/identities/{identityId}`

Attach LDAP Auth configuration onto machine identity

## Path parameters

- `identityId` string, required

## Request body

- union
  - object
    - `templateId` string, required — The ID of the identity auth template to attach the configuration onto.
    - `searchFilter` string — The filter to use to search for the LDAP user.
    - `allowedFields` object[] — The comma-separated array of key/value pairs of required fields that the LDAP entry must have in order to authenticate.
      - `key` string, required
      - `value` string, required
    - `ldapCaCertificate` string — The PEM-encoded CA certificate for the LDAP server.
    - `accessTokenTrustedIps` object[] — The IPs or CIDR ranges that access tokens can be used from.
      - `ipAddress` string, required
    - `accessTokenTTL` integer — The lifetime for an access token in seconds.
    - `accessTokenMaxTTL` integer — The maximum lifetime for an access token in seconds.
    - `accessTokenNumUsesLimit` integer — The maximum number of times that an access token can be used.
    - `lockoutEnabled` boolean — Whether the lockout feature is enabled.
    - `lockoutThreshold` number — The amount of times login must fail before locking the identity auth method.
    - `lockoutDurationSeconds` number — How long an identity auth method lockout lasts.
    - `lockoutCounterResetSeconds` number — How long to wait from the most recent failed login until resetting the lockout counter.
  - object
    - `url` string, required — The URL of the LDAP server.
    - `bindDN` string, required — The DN of the user to bind to the LDAP server.
    - `bindPass` string, required — The password of the user to bind to the LDAP server.
    - `searchBase` string, required — The base DN to search for the LDAP user.
    - `searchFilter` string — The filter to use to search for the LDAP user.
    - `allowedFields` object[] — The comma-separated array of key/value pairs of required fields that the LDAP entry must have in order to authenticate.
      - `key` string, required
      - `value` string, required
    - `ldapCaCertificate` string — The PEM-encoded CA certificate for the LDAP server.
    - `accessTokenTrustedIps` object[] — The IPs or CIDR ranges that access tokens can be used from.
      - `ipAddress` string, required
    - `accessTokenTTL` integer — The lifetime for an access token in seconds.
    - `accessTokenMaxTTL` integer — The maximum lifetime for an access token in seconds.
    - `accessTokenNumUsesLimit` integer — The maximum number of times that an access token can be used.
    - `lockoutEnabled` boolean — Whether the lockout feature is enabled.
    - `lockoutThreshold` number — The amount of times login must fail before locking the identity auth method.
    - `lockoutDurationSeconds` number — How long an identity auth method lockout lasts.
    - `lockoutCounterResetSeconds` number — How long to wait from the most recent failed login until resetting the lockout counter.

## Response `200`

Default Response

- object
  - `identityLdapAuth` object, required
    - `id` string, uuid, required
    - `accessTokenTTL` number
    - `accessTokenMaxTTL` number
    - `accessTokenNumUsesLimit` number
    - `accessTokenTrustedIps` unknown
    - `identityId` string, uuid, required
    - `url` string, required
    - `searchBase` string, required
    - `searchFilter` string, required
    - `allowedFields` unknown
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `accessTokenPeriod` number
    - `templateId` string, uuid, nullable
    - `lockoutEnabled` boolean
    - `lockoutThreshold` number
    - `lockoutDurationSeconds` number
    - `lockoutCounterResetSeconds` number

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/revisions/30e2bf535135/schema)
