Written by

Question sansa stark · Sep 13, 2018

LDAP Connectio-Config

Hi All, I tried to execute the ##Class(%SYS.LDAP).Binds(LD,"",$lb(Username,Domain,Password),$$$LDAPAUTHNEGOTIATE) but this command is returning the value as 7 only instead of 0. Is there any method to find out the error using the returned value. Please help me

Comments

Gilberto Junior · Sep 13, 2018

Hi 

Try the function


## Class (% SYS.LDAP) .Err2String (7)

Try the function, using the return code in place of 7 below
## Class (% SYS.LDAP) .Err2String (7)
My Caché is in Portuguese

This post has been translated by Google Translate, sorry for writing errors

0
sansa stark  Sep 13, 2018 to Gilberto Junior

thank you gilberto!!

0
sansa stark  Sep 13, 2018 to Gilberto Junior

Hi,when we will get the Authentication Method Not Supported how to recover it. Can you please help I'm new for this LDAP

0
Gilberto Junior  Sep 13, 2018 to sansa stark

At first your code is correct.
Here's a MOC created when I developed this kind of integration.
Class HslBus.Msg.AdService.ValidaLogin.Response Extends %Persistent
{
Property LoginAtivo As %Boolean;

}

In Other Class I'm created this Method:

ClassMethod ValidarLogin(pRequest As HslBus.Msg.AdService.ValidaLogin.Request, Output pResponse As HslBus.Msg.AdService.ValidaLogin.Response) As %Status
{
set pResponse = ##class(HslBus.Msg.AdService.ValidaLogin.Response).%New()
set BaseDN="DC=Server,DC=pvt"
set Filter="(&(objectCategory=person)(objectClass=user) (sAMAccountname=" _ pRequest.Usuario.Login _ "))"
set Attributes=""
set ServerTimeout=5000
set LD=##Class(%SYS.LDAP).Init("hsl.pvt",389)
Set Status0=##Class(%SYS.LDAP).Binds(LD,"",$lb(pRequest.Usuario.Login,"Server.pvt",pRequest.Usuario.Senha),$$$LDAPAUTHNEGOTIATE)
set checkFilter=##class(%SYS.LDAP).CheckFilter(LD,Filter)
set Status=##Class(%SYS.LDAP).SearchExts(LD,BaseDN,$$$LDAPSCOPESUBTREE,Filter,"",0,"","",10,0,.SearchResult)
if (Status = $$$LDAPSUCCESS){
set pResponse.LoginAtivo = 1
}
else{
set pResponse.LoginAtivo = 0
}
quit $$$OK
}


To verify this type of support when I developed an LDAP integration I used the LDAP Admin available at http://www.ldapadmin.org/
If you also do not connect to AD, check with the infrastructure team if AD is enabled to receive LDAP connections.

0
sansa stark · Sep 13, 2018

Hi,when we will get the Authentication Method Not Supported how to recover it. Can you please help I'm new for this LDAP

0