summaryrefslogtreecommitdiff
path: root/internal/authentication/ldap_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/authentication/ldap_util.go')
-rw-r--r--internal/authentication/ldap_util.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/authentication/ldap_util.go b/internal/authentication/ldap_util.go
index 539406372..5793a661b 100644
--- a/internal/authentication/ldap_util.go
+++ b/internal/authentication/ldap_util.go
@@ -111,6 +111,16 @@ func ldapGetReferral(err error) (referral string, ok bool) {
}
}
+func ldapGetErrorCode(err error) int {
+ var e *ldap.Error
+
+ if errors.As(err, &e) {
+ return int(e.ResultCode)
+ }
+
+ return -1
+}
+
func getValueFromEntry(entry *ldap.Entry, attribute string) string {
if attribute == "" {
return ""