Documentation ¶
Index ¶
- Constants
- type AuthProviderEntity
- type AuthenticatableEntity
- type Authentication
- func (t *Authentication) Authenticate(ormService *beeorm.Engine, uniqueValue string, password string, ...) (accessToken string, refreshToken string, err error)
- func (t *Authentication) AuthenticateByID(ormService *beeorm.Engine, id uint64, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) AuthenticateOTP(ormService *beeorm.Engine, phone string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) AuthenticateOTPEmail(ormService *beeorm.Engine, email string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
- func (t *Authentication) GenerateAndSendOTP(ormService *beeorm.Engine, mobile string, countryCodeAlpha2 string) (*GenerateOTP, error)
- func (t *Authentication) GenerateAndSendOTPEmail(ormService *beeorm.Engine, email string, template string, from string, ...) (*GenerateOTPEmail, error)
- func (t *Authentication) GenerateTokenPair(id uint64, accessKey string, ttl int) (string, error)
- func (t *Authentication) LogoutAllSessions(ormService *beeorm.Engine, id uint64)
- func (t *Authentication) LogoutCurrentSession(ormService *beeorm.Engine, accessKey string)
- func (t *Authentication) RefreshToken(ormService *beeorm.Engine, refreshToken string) (newAccessToken string, newRefreshToken string, err error)
- func (t *Authentication) SendVerifyAPIOTP(ormService *beeorm.Engine, mobile string, countryCodeAlpha2 string) error
- func (t *Authentication) VerifyAPIOTP(ormService *beeorm.Engine, mobile string, code string, ...) error
- func (t *Authentication) VerifyAccessToken(ormService *beeorm.Engine, accessToken string, entity beeorm.Entity) (map[string]string, error)
- func (t *Authentication) VerifyOTP(code string, input *GenerateOTP) error
- func (t *Authentication) VerifyOTPEmail(code string, input *GenerateOTPEmail) error
- func (t *Authentication) VerifySocialLogin(source, token string) (*social.UserData, error)
- type GenerateOTP
- type GenerateOTPEmail
- type OTPProviderEntity
Constants ¶
View Source
const ( SocialLoginGoogle = "google" SocialLoginFacebook = "facebook" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProviderEntity ¶ added in v0.3.1
type AuthProviderEntity interface { beeorm.Entity AuthenticatableEntity GetUniqueFieldName() string GetPassword() string }
type AuthenticatableEntity ¶ added in v0.9.69
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
func NewAuthenticationService ¶
func NewAuthenticationService( secret string, accessTokenTTL int, refreshTokenTTL int, otpTTL int, appService *app.App, smsService sms.ISender, generatorService generator.IGenerator, errorLoggerService errorlogger.ErrorLogger, clockService clock.IClock, passwordService password.IPassword, jwtService *jwt.JWT, mailService *mail.Sender, socialServiceMapping map[string]social.IUserData, uuidService uuid.IUUID, ) *Authentication
func (*Authentication) Authenticate ¶
func (t *Authentication) Authenticate(ormService *beeorm.Engine, uniqueValue string, password string, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) AuthenticateByID ¶ added in v0.5.0
func (t *Authentication) AuthenticateByID(ormService *beeorm.Engine, id uint64, entity AuthProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) AuthenticateOTP ¶ added in v0.3.3
func (t *Authentication) AuthenticateOTP(ormService *beeorm.Engine, phone string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) AuthenticateOTPEmail ¶ added in v0.5.8
func (t *Authentication) AuthenticateOTPEmail(ormService *beeorm.Engine, email string, entity OTPProviderEntity) (accessToken string, refreshToken string, err error)
func (*Authentication) GenerateAndSendOTP ¶ added in v0.3.3
func (t *Authentication) GenerateAndSendOTP(ormService *beeorm.Engine, mobile string, countryCodeAlpha2 string) (*GenerateOTP, error)
func (*Authentication) GenerateAndSendOTPEmail ¶ added in v0.5.8
func (t *Authentication) GenerateAndSendOTPEmail(ormService *beeorm.Engine, email string, template string, from string, title string) (*GenerateOTPEmail, error)
func (*Authentication) GenerateTokenPair ¶ added in v0.3.1
func (*Authentication) LogoutAllSessions ¶ added in v0.3.1
func (t *Authentication) LogoutAllSessions(ormService *beeorm.Engine, id uint64)
func (*Authentication) LogoutCurrentSession ¶ added in v0.3.1
func (t *Authentication) LogoutCurrentSession(ormService *beeorm.Engine, accessKey string)
func (*Authentication) RefreshToken ¶
func (*Authentication) SendVerifyAPIOTP ¶ added in v0.8.81
func (*Authentication) VerifyAPIOTP ¶ added in v0.8.81
func (*Authentication) VerifyAccessToken ¶
func (*Authentication) VerifyOTP ¶ added in v0.3.3
func (t *Authentication) VerifyOTP(code string, input *GenerateOTP) error
func (*Authentication) VerifyOTPEmail ¶ added in v0.5.8
func (t *Authentication) VerifyOTPEmail(code string, input *GenerateOTPEmail) error
func (*Authentication) VerifySocialLogin ¶ added in v0.6.2
func (t *Authentication) VerifySocialLogin(source, token string) (*social.UserData, error)
type GenerateOTP ¶ added in v0.3.3
type GenerateOTPEmail ¶ added in v0.5.8
type OTPProviderEntity ¶ added in v0.3.3
type OTPProviderEntity interface { beeorm.Entity AuthenticatableEntity GetPhoneFieldName() string GetEmailFieldName() string }
Click to show internal directories.
Click to hide internal directories.