Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("security: invalid principal or credential") ErrInvalidPrincipal = errors.New("security: principal is invalid") ErrInvalidCredential = errors.New("security: credential is invalid") ErrAccountLocked = errors.New("security: account is locked") ErrAccountDisabled = errors.New("security: account is disabled") )
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func (*Authenticator) AddRealm ¶
func (a *Authenticator) AddRealm(r ...Realm)
type Realm ¶
type Realm interface { // Name is the name of realm. Name() string // Login does authentication with token, it returns an error if failed, or nil user if skipped. Login(token Token) (security.User, error) }
func NewSimpleRealm ¶
type SimpleToken ¶
type SimpleToken struct {
// contains filtered or unexported fields
}
func (*SimpleToken) Captcha ¶
func (t *SimpleToken) Captcha() string
func (*SimpleToken) Credential ¶
func (t *SimpleToken) Credential() interface{}
func (*SimpleToken) Name ¶
func (t *SimpleToken) Name() string
func (*SimpleToken) Password ¶
func (t *SimpleToken) Password() string
func (*SimpleToken) Principal ¶
func (t *SimpleToken) Principal() interface{}
Click to show internal directories.
Click to hide internal directories.