Documentation ¶
Index ¶
- type LdapClient
- func (lc *LdapClient) Authenticate(username, password string) (bool, error)
- func (lc *LdapClient) ChangePassword(username, oldpass, newpass string) (bool, error)
- func (lc *LdapClient) Close()
- func (lc *LdapClient) Connect() error
- func (lc *LdapClient) GetAttributeOfUser(username string) (bool, map[string]string, error)
- func (lc *LdapClient) GetAvaliHost() error
- func (lc *LdapClient) GetGroupsOfUser(username string) ([]string, error)
- func (lc *LdapClient) ModifyPassword(username, oldpass, newpass string) (bool, error)
- func (lc *LdapClient) ModifyUserPhone(username, password, phone string) (bool, error)
- func (lc *LdapClient) ValidUsername(username string) (string, bool, error)
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 (*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) GetAttributeOfUser ¶
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)
检查用户名是否存在
Click to show internal directories.
Click to hide internal directories.