ldap兼容uid登陆验证。

This commit is contained in:
Mr. Lan 2020-08-20 22:37:41 +08:00
parent d0f92a5b74
commit a00816f7a5
3 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,7 @@ settings:
host: localhost
port: 389
tls: 0
userfield: uid
log:
compress: 1
consolestdout: 1

View File

@ -45,6 +45,7 @@ settings:
host: localhost
port: 389
tls: 0
userfield: uid
log:
compress: 1
consolestdout: 1

View File

@ -72,7 +72,7 @@ func searchRequest(username string) (userInfo *ldap.Entry, err error) {
0,
0,
false,
fmt.Sprintf("(cn=%s)", username),
fmt.Sprintf("(%v=%v)", viper.GetString("settings.ldap.userField"), username),
ldapFieldsFilter,
nil)