Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Uniface 9: Accessing ActiveDirectory via LDAP

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

26 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

After I had retrieved the data, the Messageframe has the following output:

I/O function: S, mode: 0, on file/table: DLDP_PERSON index: 1 >=
LDP: Error (34) Invalid DN syntax

Maybe, there is a problem with my BaseDN?? When I make a lookup with an ldap-browser with my BaseDN it works fine, only in Uniface it seems to make problems...

Can you give me an example of your asn-file with the relevant parts for LDAP please?


Author: None (None)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Difficult to say as I can't see the details of what you are doing. Why not post a messageframe with /pri=255 ?


Author: None (None)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Hi,

thank you for the example code!

Unfortunately, I always get the return code "-3" (I/O-Error) after the retrieve statement. Procerrorcontext said:

"ERROR=-3·;MNEM=<UIOSERR_EXCEPTIONAL>·;DESCRIPTION=I/O error·;COMPONENT=LDAP·;PROCNAME=GETEM·;TRIGGER=OPER·;LINE=2"

It seems like the connection is ok. After the connect statement $status returns "0", but whenever the read trigger runs, the I/O-error occurs.

I adjusted the asn-file as follows:

[...

[DRIVER_SETTINGS]
LDP = U1.0

[ENTITIES]
*.ldap = $LDP:*.*

[PATHS]
$LDP=LDP:

[LOGICALS]
ldap_server=[MyServerName]
ldap_port=389
ldap_userdn=[myUsername]
ldap_passwd=[myPassword]
ldap_searchbase=
ldap_cn=

 ...]

Do you have any suggestions, what could be wrong?


Author: None (None)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Here is the model and form I use to test retrieve from Microsoft Exchange with the LDAP driver. ftp://ftp.compuware.com/pub/uniface/outgoing/cbr/ldap.xml Hope this helps !


Author: None (None)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

I don't think Active Directory knows what the logged on user of the PC is. You can use the proc function $setting like this: $setting ("", "USERNAME", "ENVDATA") or directly call the Windows function GetUserNameA or GetUserNameW in advapi32.dll by means of a C signature. Hope this helps.


Author: None (None)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Hi,

Is here anybody who knows how to access the Logon User via Windows Active Directory?

There is a .dll or Uniface function that returns de logged User name?

Thanks

 


Author: parcaya (parcaya@compuamerica.com.ve)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Paul Koldijk dit a presentation on Uniface and LDAP in the Spring 2011 meeting of the Dutch usergroup: http://www.uniface.nl/wp-content/uploads/2011/07/presentatie_paul_koldijk.pdf


Author: Theo Neeskens (tneeskens@itblockz.nl)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Hi Iain,Arjen, Thanks for your response. I am able to retrieve the data from LDAP, yes I am using U1.0 LDAP driver setting and using asn settings as per Paul's presentation. Now, the next thing is to authenticate using username(samaccountname)  and password at login. When I keep the asn path as "$LDP LDP:host+389:DC=abc,DC=co,DC=uk|username|password" and do the retrieve on form by initialising samaccountname, it work correctly. However, if I keep the username and password in the asn path as blank and try to run the open command based on the logging in user and password, at that point open command always give $status as 0, even if the username and password combination is incorrect. Please could you suggest any ways to achieve the authentication process using username and password. And also currently I am trying with port 389, whereas it was not working if I was trying with port 636. Also, I tried setting the LDAP path in asn with generic username password, then once connection with ldap is established, retrieve using samaccountname, then again try to connect to ldap using the DN and password for that user. But DN name comes as blank after retrieve and if I add distinguishedName field, then application just crashes. Anyway to fetch DN name in retrieve? Thanks Dharmesh


Author: dharmesh (pandey.dharmesh@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

Hi, I have dug up the PAM for Uniface version 9.2.02 from my personal archive and it states that LDAP 3.0 is supported through the U1.0 LDAP driver. Is this the driver you have been using? The LDAP error you are getting is a very generic one, according to documentation. Paul Koldijk's presentation is still available, if you'd like to review it. Perhaps below URL's can also help you:

Cheers, Arjen


Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Accessing ActiveDirectory via LDAP

Author: None (None)

Hi community,

is here anybody who knows how to access the Windows ActiveDirectory via the Uniface LDAP driver?

I'd like to query some user information from the AD and display it in a simple form.

I would really appreciate it if anybody have some examples for me!

Thanks!

 I wound up using ms webservices, but couldn't get them to work directly with Uniface, so I have written a very small COM interface to the MS webservices universe, which I add functions to as I need them... 


Author: Iain Sharp (i.sharp@pcisystems.co.uk)