FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FW user login to authenticate from windows active directory
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FW user login to authenticate from windows active directory
Posted: Thu Jun 24, 2021 02:27 PM
Is this code what we are looking for ?

https://wightideas.org/2014/06/25/excel-ldap-authentication/

We could easily adapt it to Harbour and FWH
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FW user login to authenticate from windows active directory
Posted: Tue Jun 29, 2021 12:17 PM
This code from Charly, Felix and others is what we were looking for:

Code (fw): Select all Collapse
FUNCTION ConectaLDAP()
LOCAL lOk    := FALSE

TRY
// Creamos el objeto ADO de conexión
    oConexion:= TOleAuto():new( "ADODB.Connection" )
    oConexion:Provider:= 'ADsDSOObject'
    oProperties := oConexion:Properties( 'User ID' )
    oProperties:value := 'Your User'
   
    oProperties := oConexion:Properties( 'Password' )
    oProperties:value := 'Your Password'
    oProperties := oConexion:Properties( 'Encrypt Password' )
    oProperties:value := TRUE
// Abrimos la conexión 
    oConexion:Open( "Active Directory Provider" )
   lOk := TRUE
   
CATCH oError
    AdoError( oError, lMessage )
    //xBrowse( oError )
END

RETURN lOk
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion