validator

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FacebookTokenValidator

type FacebookTokenValidator struct {
	APIClient     *resty.Client
	ApplicationID string
}

FacebookTokenValidator to validate the facebook OAuth tokens

func NewFacebookTokenValidator

func NewFacebookTokenValidator(applicationID, APIVersion string, timeOut, retryCount int, debugMode bool) *FacebookTokenValidator

NewFacebookTokenValidator returns a new FacebookUserInfos struct

func (*FacebookTokenValidator) SourceName

func (validator *FacebookTokenValidator) SourceName() string

SourceName returns the source name of the token

func (*FacebookTokenValidator) VerifyTokenAndExtractInfos

func (validator *FacebookTokenValidator) VerifyTokenAndExtractInfos(token string) (TokenInfos, bool)

VerifyTokenAndExtractInfos verifies a facebook access token and extracts the user informations from the token

type GoogleTokenValidator

type GoogleTokenValidator struct {
	APIClient *resty.Client
	ClientID  string
}

GoogleTokenValidator to validate the google OAuth tokens

func NewGoogleTokenValidator

func NewGoogleTokenValidator(clientID, APIVersion string, timeOut, retryCount int, debugMode bool) *GoogleTokenValidator

NewGoogleTokenValidator returns a new GoogleTokenValidator struct

func (*GoogleTokenValidator) SourceName

func (validator *GoogleTokenValidator) SourceName() string

SourceName returns the source name of the token

func (*GoogleTokenValidator) VerifyTokenAndExtractInfos

func (validator *GoogleTokenValidator) VerifyTokenAndExtractInfos(token string) (TokenInfos, bool)

VerifyTokenAndExtractInfos verifies a facebook access token

type TokenInfos

type TokenInfos struct {
	Token     string
	UserID    string
	Email     string
	LastName  string
	FirstName string
	CreatedAt time.Time
	ExpiresAt time.Time
}

TokenInfos struct about the informations of a token

type TokenValidator

type TokenValidator interface {
	SourceName() string
	VerifyTokenAndExtractInfos(token string) (TokenInfos, bool)
}

TokenValidator validates a auth token

Jump to

Keyboard shortcuts

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