Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidCredentials is an error message when credentials are invalid ErrInvalidCredentials = errors.New("Invalid Username or Password") // ErrUsernameAlreadyTaken is an error message when the username is already used by someone else ErrUsernameAlreadyTaken = errors.New("Username already taken") // ErrUsernameAlreadyTakenOnLDAP is an error message when the username is already used by someone else on LDAP ErrUsernameAlreadyTakenOnLDAP = errors.New("Username already taken in the configured LDAP server. Try login instead") )
Functions ¶
func SendWelcomeEmail ¶
SendWelcomeEmail sends a welcome email after a user's registration
Types ¶
type Attributes ¶
type Attributes struct { Username string Firstname string Lastname string Realname string Email string }
Attributes list all LDAP attributes names in the LDAP
type Authentication ¶
Authentication contains all APIs entrypoints needed for authentication
func (*Authentication) AuthenticateUser ¶
func (a *Authentication) AuthenticateUser(query *LoginUserQuery) error
AuthenticateUser authenticates a user
func (*Authentication) CreateLoginToken ¶
func (a *Authentication) CreateLoginToken(username string) (string, error)
CreateLoginToken generates a signed JWT Token from user to get the token when logged in.
type LDAP ¶
type LDAP struct {
// contains filtered or unexported fields
}
LDAP is an LDAP entry point allowing authentication with an LDAP server
func (*LDAP) Login ¶
func (a *LDAP) Login(query *LoginUserQuery) (*LDAPUserInfo, error)
Login log the user in
type LDAPConf ¶
type LDAPConf struct { LdapServer string BaseDN string BindDN string BindPassword string SearchFilter string Attr Attributes }
LDAPConf contains data used to connect to an LDAP directory service
type LDAPUserInfo ¶
type LDAPUserInfo struct { DN string Username string FirstName string LastName string RealName string Email string }
LDAPUserInfo contains LDAP attributes values for a user
type LoginUserQuery ¶
LoginUserQuery represents connection data
type MyCustomClaims ¶
type MyCustomClaims struct { Username string `json:"username"` jwt.StandardClaims }
MyCustomClaims contains data that will be signed in the JWT token
Click to show internal directories.
Click to hide internal directories.