jtblin / go-ldap-client

Simple ldap client to authenticate, retrieve basic information and groups for a user.
Other
261 stars 90 forks source link

error #24

Closed andreaneri closed 2 years ago

andreaneri commented 4 years ago

Hello, I'm trying to differ these two kind of error: -Error authenticating user username: LDAP Result Code 200 "Network Error": dial tcp x.y.z.w:389: i/o timeout -Error authenticating user username: LDAP Result Code 49 "Invalid Credentials": 8009030C: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580

i'd like to map in this way: timeout -> 500 "Invalid Credentials" -> 4xx the problem is, in both case, err is not null, thanks

Joffcom commented 4 years ago

It may not help but with the ldap return codes you would be better off sticking with what you get as they are mostly defined in the LDAP RFC so your error 49 has different reasons that can be worked out by the data code.