ldap

package
v0.0.0-...-c6de284 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LdapGroup

type LdapGroup struct {
	Path string
	Role easyauth.Role
}

type LdapProvider

type LdapProvider struct {
	//name of domain
	Domain string
	//user base dn (for LDAP Auth)
	UserBaseDn string
	//server to query
	LdapAddr string
	//if untrusted certs should be allowed
	AllowInsecure bool
	//Permissions granted to any user who successfully authenticates
	DefaultPermission easyauth.Role
	//List of groups to grant additional permissions
	Groups []*LdapGroup
	//Individual user permissions
	Users map[string]easyauth.Role
	//Root search path to check group memberships. Ex "DC=myorg,DC=com"
	RootSearchPath string

	//Name to use for cookie
	CookieName string

	// Function to call on successful login. Can change user data or roles if desired.
	// return non-nil error to deny the login
	OnLogin func(u *easyauth.User) error

	OnLoginFail func(string)
}

func (*LdapProvider) Authorize

func (l *LdapProvider) Authorize(un, pw string) easyauth.Role

func (*LdapProvider) GetRequiredFields

func (l *LdapProvider) GetRequiredFields() []string

func (*LdapProvider) GetUser

func (l *LdapProvider) GetUser(r *http.Request) (*easyauth.User, error)

func (*LdapProvider) HandlePost

func (l *LdapProvider) HandlePost(w http.ResponseWriter, r *http.Request)

func (*LdapProvider) Logout

func (l *LdapProvider) Logout(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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