Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

LDAP.JSON

Queries JSON structure of LDAP data.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
LDAP JSON 8.0 Yes Yes Yes Yes No

MBS( "LDAP.JSON"; LDAPRef )

Parameters

Parameter Description Example value
LDAPRef The reference number for the LDAP connection. $ldap

Result

Returns OK or error.

Description

Queries JSON structure of LDAP data.
Please first search, than query here the result as JSON.

Examples

Query JSON:

# Connect
Set Variable [ $r ; Value: MBS("LDAP.Connect"; "ldap.forumsys.com"; 0; 389) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "LDAP error" ; "Failed to connect." & ¶ & $r ]
Else
    Set Variable [ $ldap ; Value: $r ]
    # Login
    Set Variable [ $r ; Value: MBS("LDAP.Bind"; $ldap; "uid=tesla,dc=example,dc=com"; "password"; "simple") ]
    If [ MBS("IsError") ]
        Show Custom Dialog [ "LDAP error" ; "Failed to authenticate." & ¶ & $r ]
    Else
        # Search
        Set Variable [ $r ; Value: MBS("LDAP.Search"; $ldap; "dc=example,dc=com"; "subtree"; "(givenName=*)"; ""; 0; 20; 999) ]
        # Check results
        Show Custom Dialog [ "JSON" ; MBS("LDAP.JSON"; $ldap) ]
    End If
    # Cleanup
    Set Variable [ $r ; Value: MBS("LDAP.Release"; $ldap) ]
End If

Example result:
[{
    "dn":   "uid=test,dc=example,dc=com",
    "attributes":   [{
        "name":   "objectClass",
        "values":   ["posixAccount", "top", "inetOrgPerson"]
      }, {
        "name":   "gidNumber",
        "values":   ["0"]
      }, {
        "name":   "givenName",
        "values":   ["Test"]
      }, {
        "name":   "sn",
        "values":   ["Test"]
      }, {
        "name":   "displayName",
        "values":   ["Test"]
      }, {
        "name":   "uid",
        "values":   ["test"]
      }, {
        "name":   "initials",
        "values":   ["TS"]
      }, {
        "name":   "homeDirectory",
        "values":   ["home"]
      }, {
        "name":   "cn",
        "values":   ["Test"]
      }, {
        "name":   "uidNumber",
        "values":   ["24601"]
      }, {
        "name":   "o",
        "values":   ["Company"]
      }]
  }]

See also

Created 11st December 2017, last changed 20th February 2018


LDAP.GetTimeOut   -   LDAP.Modify

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins