auther

package
v0.0.0-...-cbea63e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0, MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorChangePassword    = errors.New("Authentication failed - you must change your password")
	ErrorAccountIsDisabled = errors.New("Authentication failed - your account is disabled")
	ErrorAccountIsExpired  = errors.New("Authentication failed - your account is expired")
)

Functions

func Auth

func Auth(app domain.Application, deviceType, username string, password, newPassword []byte, meta map[string]string, session *domain.Session) (*domain.Session, error)

Auth wraps defaultInstance.Auth

func AuthAs

func AuthAs(app domain.Application, deviceType, username string, meta map[string]string) (*domain.Session, error)

AuthAs wraps defaultInstance.AuthAs

func AutoRenew

func AutoRenew(s *domain.Session) (*domain.Session, error)

AutoRenew wraps defaultInstance.AutoRenew

func ChangePassword

func ChangePassword(user *domain.User, newPassword string, activeSession *domain.Session) error

ChangePassword wraps defaultInstance.ChangePassword

func Expire

func Expire(s *domain.Session) error

Expire wraps defaultInstance.Expire

func OAuth

func OAuth(app domain.Application, deviceType, username, token, provider string, meta map[string]string) (*domain.Session, error)

OAuth wraps defaultInstance.OAuth

func ValidateAuth

func ValidateAuth(app domain.Application, username string, password []byte) error

ValidateAuth wraps defaultInstance.ValidateAuth

Types

type Auther

type Auther interface {
	Auth(app domain.Application, deviceType, username string, password, newPassword []byte, meta map[string]string, session *domain.Session) (*domain.Session, error)
	AuthAs(app domain.Application, deviceType, username string, meta map[string]string) (*domain.Session, error)
	OAuth(app domain.Application, deviceType, username, oauthtoken, oauthprovider string, meta map[string]string) (*domain.Session, error)
	AutoRenew(s *domain.Session) (*domain.Session, error)
	Expire(s *domain.Session) error
	// ChangePassword changes a user's password for the passed newPassword. It will also immediately invalidate the
	// user's _other_ active sessions; that is, it will not invalidate the passed active session. If activeSession is
	// nil, _all_ the user's sessions will be invalidated.
	ChangePassword(user *domain.User, newPassword string, activeSession *domain.Session) error
	ValidateAuth(app domain.Application, username string, password []byte) error
}

Jump to

Keyboard shortcuts

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