FW user login to authenticate from windows active directory

User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: FW user login to authenticate from windows active directory

Post by Antonio Linares »

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
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: FW user login to authenticate from windows active directory

Post by Antonio Linares »

This code from Charly, Felix and others is what we were looking for:

Code: Select all | Expand

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
Post Reply