diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-05-11 11:56:04 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-05-11 11:56:04 +0800 |
commit | 4d6de6c7b9715a6ccce3f09249b47b984b9a1295 (patch) | |
tree | 9c0d588a94b5c9fea4b7bc35c8f65672fc7b7dfd /modules/auth/ldap | |
parent | 43ffacd05b7b5c9d7b4966f4404a7dc53f2229aa (diff) |
add login name for auth type
Diffstat (limited to 'modules/auth/ldap')
-rw-r--r-- | modules/auth/ldap/ldap_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/auth/ldap/ldap_test.go b/modules/auth/ldap/ldap_test.go new file mode 100644 index 00000000..80965737 --- /dev/null +++ b/modules/auth/ldap/ldap_test.go @@ -0,0 +1,32 @@ +package ldap + +import ( + "fmt" + "testing" +) + +var ldapServer = "ldap.itd.umich.edu" +var ldapPort = uint16(389) +var baseDN = "dc=umich,dc=edu" +var filter = []string{ + "(cn=cis-fac)", + "(&(objectclass=rfc822mailgroup)(cn=*Computer*))", + "(&(objectclass=rfc822mailgroup)(cn=*Mathematics*))"} +var attributes = []string{ + "cn", + "description"} +var msadsaformat = "" + +func TestLDAP(t *testing.T) { + AddSource("test", ldapServer, ldapPort, + basedn, attributes, filter, + msadsaformat) + user, err := LoginUserLdap("xiaolunwen", "") + if err != nil { + t.Error(err) + return + } + + fmt.Println(user) + +} |