ldap

package
v0.0.0-...-bd43069 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound indicates the user was not found in the authentication backend
	ErrUserNotFound = errors.New("user not found")
	// ErrMoreThanOne is returned whenever more than one AD record was returned as we cant properly distinguish which record we should use
	ErrMoreThanOne = errors.New("more than one record has been found")
	// ErrInvalidCert is returned whenever the CA cert was given to us for use in the LDAP provider but is invalid
	ErrInvalidCert = errors.New("invalid root ca cert")
	// ErrDisabled is returned when a function is called that is not supported by the LDAP provider
	ErrDisabled = errors.New("disabled in ldap authentication")
)

Functions

This section is empty.

Types

type Backend

type Backend struct {
	*Options
	// contains filtered or unexported fields
}

Backend is an authentication backend that queries an LDAP/Active Directory server for authentication

func Init

Init creates a new LDAP authentication backend

func (*Backend) CanUsersRegister

func (s *Backend) CanUsersRegister() bool

CanUsersRegister is disabled in the LDAP authentication backend

func (*Backend) Close

func (s *Backend) Close()

Close implements authentication.Close but we have nothing to free here.

func (*Backend) CreateUser

func (s *Backend) CreateUser(user storage.User) error

CreateUser is disabled in the LDAP authentication backend

func (*Backend) GenerateSecurePassword

func (s *Backend) GenerateSecurePassword(password string) (string, error)

GenerateSecurePassword is disabled in the LDAP authentication backend

func (*Backend) Login

func (s *Backend) Login(username, password string) (*storage.User, error)

Login searches the database backend for a matching user record

func (*Backend) UserCanChangePassword

func (s *Backend) UserCanChangePassword() bool

UserCanChangePassword is disabled in the LDAP authentication backend

type LDAPAuthPlugin

type LDAPAuthPlugin struct{}

LDAPAuthPlugin implements Open which is used to register the LDAP provider with the backend

func (*LDAPAuthPlugin) Open

Open initializes the LDAP Authentication Provider

type Options

type Options struct {
	Address      string `yaml:"address"`
	Base         string `yaml:"base_dn"`
	BindDN       string `yaml:"bind_dn"`
	BindPassword string `yaml:"bind_password"`
	RootCACert   string `yaml:"root_ca"`
}

Options contains all the LDAP configuration options

Jump to

Keyboard shortcuts

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