LDAPProviders

Authorize an LDAP provider and retrieve a token

post

Authorizes the LDAP provider by slug and returns an authorization token.

Authorizations
Path parameters
slugstringRequired

The slug of the resource.

Example: obj_slug
Body
usernamestringOptional

Username to authorize

Example: john.doe
passwordstringOptional

Password for the given username

Example: password123
Responses
200
Authorization successful, returns the token.
application/json
post
POST /api/v1/ldap/{slug}/authorize/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "username": "john.doe",
  "password": "password123"
}
{
  "key": "foo"
}

Retrieve LDAP provider

get

Retrieve details for a specific LDAP provider by slug.

Authorizations
Path parameters
slugstringRequired

The slug of the resource.

Example: obj_slug
Responses
200
LDAP provider details
application/json
get
GET /api/v1/ldap/{slug}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "id": 1,
  "name": "Active Directory",
  "slug": "active_directory",
  "icon": "binary",
  "host": "ldap://ldap.example.com",
  "port": 389,
  "use_ssl": true,
  "bind_dn": "cn=admin,dc=example,dc=com",
  "bind_password": "secure_password",
  "base_dn": "dc=example,dc=com",
  "attribute_map": {
    "uid": "username",
    "mail": "email"
  },
  "is_active": true
}

Update LDAP provider

put

Update an existing LDAP provider. Only superusers can perform this action.

Authorizations
Path parameters
slugstringRequired

The slug of the resource.

Example: obj_slug
Body
idinteger · int64Optional

LDAP Provider ID

namestring · max: 256Optional

Name of the LDAP provider.

Example: Active Directory
slugstring · max: 256Optional

Unique slug for the LDAP provider.

Example: active_directory
iconstring · binaryOptional

Icon for the LDAP provider.

hoststring · urlOptional

Host URL for the LDAP provider.

Example: ldap://ldap.example.com
portinteger · max: 65535Optional

Port number to connect to the LDAP server.

Example: 389
use_sslbooleanOptional

Indicates whether SSL is used for the LDAP connection.

Example: true
bind_dnstring · max: 256Optional

The distinguished name (DN) for binding to the LDAP server.

Example: cn=admin,dc=example,dc=com
bind_passwordstring · max: 512Optional

Password for the LDAP bind user.

Example: secure_password
base_dnstring · max: 256Optional

The base distinguished name (DN) for LDAP searches.

Example: dc=example,dc=com
attribute_mapobjectOptional

A mapping of LDAP attributes to system fields.

Example: {"uid":"username","mail":"email"}
is_activebooleanOptional

Indicates if the LDAP provider is active.

Example: true
Responses
200
LDAP provider updated successfully
application/json
put
PUT /api/v1/ldap/{slug}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 305

{
  "id": 1,
  "name": "Active Directory",
  "slug": "active_directory",
  "icon": "binary",
  "host": "ldap://ldap.example.com",
  "port": 389,
  "use_ssl": true,
  "bind_dn": "cn=admin,dc=example,dc=com",
  "bind_password": "secure_password",
  "base_dn": "dc=example,dc=com",
  "attribute_map": {
    "uid": "username",
    "mail": "email"
  },
  "is_active": true
}
{
  "id": 1,
  "name": "Active Directory",
  "slug": "active_directory",
  "icon": "binary",
  "host": "ldap://ldap.example.com",
  "port": 389,
  "use_ssl": true,
  "bind_dn": "cn=admin,dc=example,dc=com",
  "bind_password": "secure_password",
  "base_dn": "dc=example,dc=com",
  "attribute_map": {
    "uid": "username",
    "mail": "email"
  },
  "is_active": true
}

Delete LDAP provider

delete

Delete an existing LDAP provider. Only superusers can perform this action.

Authorizations
Path parameters
slugstringRequired

The slug of the resource.

Example: obj_slug
Responses
204
No content
delete
DELETE /api/v1/ldap/{slug}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Accept: */*

No content

List LDAP providers

get

Retrieve a list of all LDAP providers. Non-superusers only can see active providers.

Authorizations
Responses
200
List of LDAP providers
application/json
get
GET /api/v1/ldap/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Accept: */*
[
  {
    "id": 1,
    "name": "Active Directory",
    "slug": "active_directory",
    "icon": "binary",
    "host": "ldap://ldap.example.com",
    "port": 389,
    "use_ssl": true,
    "bind_dn": "cn=admin,dc=example,dc=com",
    "bind_password": "secure_password",
    "base_dn": "dc=example,dc=com",
    "attribute_map": {
      "uid": "username",
      "mail": "email"
    },
    "is_active": true
  }
]

Create LDAP provider

post

Create a new LDAP provider. Only superusers can perform this action.

Authorizations
Body
idinteger · int64Optional

LDAP Provider ID

namestring · max: 256Optional

Name of the LDAP provider.

Example: Active Directory
slugstring · max: 256Optional

Unique slug for the LDAP provider.

Example: active_directory
iconstring · binaryOptional

Icon for the LDAP provider.

hoststring · urlOptional

Host URL for the LDAP provider.

Example: ldap://ldap.example.com
portinteger · max: 65535Optional

Port number to connect to the LDAP server.

Example: 389
use_sslbooleanOptional

Indicates whether SSL is used for the LDAP connection.

Example: true
bind_dnstring · max: 256Optional

The distinguished name (DN) for binding to the LDAP server.

Example: cn=admin,dc=example,dc=com
bind_passwordstring · max: 512Optional

Password for the LDAP bind user.

Example: secure_password
base_dnstring · max: 256Optional

The base distinguished name (DN) for LDAP searches.

Example: dc=example,dc=com
attribute_mapobjectOptional

A mapping of LDAP attributes to system fields.

Example: {"uid":"username","mail":"email"}
is_activebooleanOptional

Indicates if the LDAP provider is active.

Example: true
Responses
201
LDAP provider created successfully
application/json
post
POST /api/v1/ldap/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 305

{
  "id": 1,
  "name": "Active Directory",
  "slug": "active_directory",
  "icon": "binary",
  "host": "ldap://ldap.example.com",
  "port": 389,
  "use_ssl": true,
  "bind_dn": "cn=admin,dc=example,dc=com",
  "bind_password": "secure_password",
  "base_dn": "dc=example,dc=com",
  "attribute_map": {
    "uid": "username",
    "mail": "email"
  },
  "is_active": true
}
{
  "id": 1,
  "name": "Active Directory",
  "slug": "active_directory",
  "icon": "binary",
  "host": "ldap://ldap.example.com",
  "port": 389,
  "use_ssl": true,
  "bind_dn": "cn=admin,dc=example,dc=com",
  "bind_password": "secure_password",
  "base_dn": "dc=example,dc=com",
  "attribute_map": {
    "uid": "username",
    "mail": "email"
  },
  "is_active": true
}

Was this helpful?