Skip to main content

LDAP Authentication

This API authenticates a user against the connected LDAP directory server and returns an access token and refresh token on success.

Endpoint Details

URL/v1/ldap/authenticate
MethodPOST
AuthorizationBearer Token

Request Headers

HeaderTypeDescription
Content-TypeStringMust be application/json

Request Body

Use the following format to make a request:

JSON Request
{
"username": "member_aplikasi",
"password": "your_password"
}

Parameters

ParameterTypeDescription
usernameStringLDAP account name of the user authenticating
passwordStringLDAP password of the user authenticating

Response

Here is an example response after the request has been successfully processed:

Response
{
"access_token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiI1NjNjOTQxYi1mMTlmLTQ3NjgtODI4NS1mZjgxYWQ4ZTZmNTUiLCJlbWFpbCI6Im1lbWJlcmFwbGlrYXNpNzIwQGdtYWlsLmNvbSIsILWYxOWYtNDc2OC04Mjg1LWZmODFhZDhlNmY1NSIsImV4cCI6MTc4NTEzMjMzOCwiaWF0IjoxNzg1MTI4NzM4fQ.5kPniTpWtQcLXb5a08RBdoMj_WUmJXO95mmkaYKt2IF0mnBIaMd3tJE5VVl84PDR3LKMct3nM65YoJEMsavMCQ",
"refresh_token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NjNjOTQxYi1mMTlmLTQ3NjgtODI4NS1mZjgxYWQ4ZTZmNTUiLCJleHAiOjE3ODUyMTUxMzgsImlhdCI6MTc4NTEyODczOH0.sDzFvP1IDz-kPg-3sJzFYkLXsR6FaZVDWpEklUbnxPXfA3Qwwb3MkC043iingMzIVO4u0AZjgqybWOMoyrTuBA",
"expires_at": 1785132338,
"email": "member.aplikasi@example.com"
}

Field Descriptions

FieldTypeDescription
access_tokenStringJWT access token used to authenticate subsequent requests
refresh_tokenStringJWT refresh token used to obtain a new access token
expires_atIntegerExpiration timestamp of the access token in Unix format
emailStringEmail address of the authenticated user

info
  • A valid Bearer Token is required to access this endpoint.
  • The user must exist in the connected LDAP directory.
  • Use the access_token as the Bearer Token for subsequent API requests, and the refresh_token to obtain a new access token when it expires.
  • Store the returned tokens securely and never expose them.
  • Unix timestamp fields can be converted to a human-readable date and time format as needed.