Help us shape the future of Go! Take the 2026 Go Developer Survey

authentication

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func NewAuthenticationService

func NewAuthenticationService(
	secret string,
	accessTokenTTL int,
	refreshTokenTTL int,
	ormService *orm.Engine,
	passwordService *password.Password,
	jwtService *jwt.JWT,
) *Authentication

func (*Authentication) Authenticate

func (t *Authentication) Authenticate(email string, password string, entity EmailPasswordProviderEntity) (accessToken string, refreshToken string, err error)

func (*Authentication) RefreshToken

func (t *Authentication) RefreshToken(refreshToken string) (newAccessToken string, newRefreshToken string, err error)

func (*Authentication) VerifyAccessToken

func (t *Authentication) VerifyAccessToken(accessToken string, entity orm.Entity) error

type EmailPasswordProviderEntity

type EmailPasswordProviderEntity interface {
	orm.Entity
	GetEmailCachedIndexName() string
	GetPassword() string
}

Jump to

Keyboard shortcuts

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