Documentation
¶
Index ¶
- type AuthProviderEntity
- type Authentication
- func (t *Authentication) Authenticate(uniqueValue string, password string, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) AuthenticateByID(id uint64, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) AuthenticateOTP(phone string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) GenerateAndSendOTP(mobile string, country string) (*GenerateOTP, error)
- func (t *Authentication) GenerateTokenPair(id uint64, accessKey string, ttl int) (string, error)
- func (t *Authentication) LogoutAllSessions(id uint64)
- func (t *Authentication) LogoutCurrentSession(accessKey string)
- func (t *Authentication) RefreshToken(refreshToken string) (newAccessToken string, newRefreshToken string, err error)
- func (t *Authentication) VerifyAccessToken(accessToken string, entity orm.Entity) (map[string]string, error)
- func (t *Authentication) VerifyOTP(code string, input *GenerateOTP) error
- type GenerateOTP
- type OTPProviderEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProviderEntity ¶ added in v0.3.1
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
func NewAuthenticationService ¶
func NewAuthenticationService( secret string, accessTokenTTL int, refreshTokenTTL int, otpTTL int, ormService *orm.Engine, smsService sms.ISender, generatorService generator.Generator, clockService clock.Clock, cacheService *orm.RedisCache, passwordService *password.Password, jwtService *jwt.JWT, ) *Authentication
func (*Authentication) Authenticate ¶
func (t *Authentication) Authenticate(uniqueValue string, password string, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) AuthenticateByID ¶ added in v0.5.0
func (t *Authentication) AuthenticateByID(id uint64, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) AuthenticateOTP ¶ added in v0.3.3
func (t *Authentication) AuthenticateOTP(phone string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) GenerateAndSendOTP ¶ added in v0.3.3
func (t *Authentication) GenerateAndSendOTP(mobile string, country string) (*GenerateOTP, error)
func (*Authentication) GenerateTokenPair ¶ added in v0.3.1
func (*Authentication) LogoutAllSessions ¶ added in v0.3.1
func (t *Authentication) LogoutAllSessions(id uint64)
func (*Authentication) LogoutCurrentSession ¶ added in v0.3.1
func (t *Authentication) LogoutCurrentSession(accessKey string)
func (*Authentication) RefreshToken ¶
func (t *Authentication) RefreshToken(refreshToken string) (newAccessToken string, newRefreshToken string, err error)
func (*Authentication) VerifyAccessToken ¶
func (*Authentication) VerifyOTP ¶ added in v0.3.3
func (t *Authentication) VerifyOTP(code string, input *GenerateOTP) error
type GenerateOTP ¶ added in v0.3.3
type OTPProviderEntity ¶ added in v0.3.3
Click to show internal directories.
Click to hide internal directories.