0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-26 09:24:07 -05:00
forgejo/modules/auth/ldap/ldap_test.go

33 lines
590 B
Go
Raw Normal View History

2014-05-10 22:56:04 -05:00
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)
}