Functions - ldap

doAuthenticate
I

Authenticates with the username and password.

getGroups
I

Retrieves the group(s) of the user related to the provided username.

initLdapConnectionContext
I

Initailizes the LDAP connection context.

doAuthenticate

(LdapConnection ldapConnection, string username, string password)

returns boolean | Error
Isolated Function

Authenticates with the username and password.

 boolean|ldap:Error result = ldap:doAuthenticate(ldapConnection, username, password);

Parameters

  • username string
  • Username of the user to be authenticated

  • password string
  • Password of the user to be authenticated

  • Return Type

    (boolean | Error)
  • true if authentication is successful, false otherwise, or else an ldap:Error if an error occurred

getGroups

(LdapConnection ldapConnection, string username)

returns string[] | Error
Isolated Function

Retrieves the group(s) of the user related to the provided username.

 string[]|ldap:Error groups = ldap:getGroups(ldapConnection, username);

Parameters

  • username string
  • Username of the user to be checked for the groups

  • Return Type

    (string[] | Error)
  • Array of groups of the provided user or else an ldap:Error if it fails

initLdapConnectionContext

(LdapConnectionConfig ldapConnectionConfig, string instanceId)

returns LdapConnection | Error
Isolated Function

Initailizes the LDAP connection context.

 ldap:LdapConnection|ldap:Error connection = ldap:initLdapConnectionContext(ldapConnectionConfig, instanceId);

Parameters

  • instanceId string
  • Instance ID of the endpoint

  • Return Type

    (LdapConnection | Error)
  • The ldap:LdapConnection instance or else an ldap:Error if an error occurred