ldap

package
v0.0.0-...-0b57644 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LdapClient

type LdapClient struct {
	Attributes         []string
	Base               string
	BindDN             string
	BindPassword       string
	GroupFilter        string // e.g. "(memberUid=%s)"
	Hosts              []string
	Host               string
	ServerName         string
	UserFilter         string // e.g. "(uid=%s)"
	Conn               *ldap.Conn
	Port               int
	InsecureSkipVerify bool
	UseSSL             bool
	SkipTLS            bool
	ClientCertificates []tls.Certificate // SSL连接证书
}

func NewLdapClient

func NewLdapClient(base string, ips string, port int, usessl int, binddn string, bindpass string, userfilter string) *LdapClient

func (*LdapClient) Authenticate

func (lc *LdapClient) Authenticate(username, password string) (bool, error)

Authenticate authenticates the user against the ldap backend.

func (*LdapClient) ChangePassword

func (lc *LdapClient) ChangePassword(username, oldpass, newpass string) (bool, error)

方法不支持

func (*LdapClient) Close

func (lc *LdapClient) Close()

Close closes the ldap backend connection.

func (*LdapClient) Connect

func (lc *LdapClient) Connect() error

连接LDAP

func (*LdapClient) GetAttributeOfUser

func (lc *LdapClient) GetAttributeOfUser(username string) (bool, map[string]string, error)

func (*LdapClient) GetAvaliHost

func (lc *LdapClient) GetAvaliHost() error

func (*LdapClient) GetGroupsOfUser

func (lc *LdapClient) GetGroupsOfUser(username string) ([]string, error)

GetGroupsOfUser returns the group for a user.

func (*LdapClient) ModifyPassword

func (lc *LdapClient) ModifyPassword(username, oldpass, newpass string) (bool, error)

方法待验证

func (*LdapClient) ModifyUserPhone

func (lc *LdapClient) ModifyUserPhone(username, password, phone string) (bool, error)

func (*LdapClient) ValidUsername

func (lc *LdapClient) ValidUsername(username string) (string, bool, error)

检查用户名是否存在

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL