login

package
v0.0.0-...-df0fe4b Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest       = errors.New("invalid_request")
	ErrInvalidClient  error = errors.New("invalid_client")
	ErrInvalidGrant   error = errors.New("invalid_grant")
	ErrInvalidToken   error = errors.New("invalid_token")
	ErrTokenExpired   error = errors.New("token_expired")
)

Functions

func AuthorizationCode

func AuthorizationCode(req TokenRequest) (*dbTypes.OAuthLogin, *dbTypes.User, error)

func CleanupAuthorization

func CleanupAuthorization(req TokenRequest) (bool, error)

func CreateRefreshToken

func CreateRefreshToken(login *dbTypes.OAuthLogin, user *dbTypes.User) (string, error)

func HandleGrantType

func HandleGrantType(req TokenRequest) (*dbTypes.OAuthLogin, *dbTypes.User, error)

func RefreshToken

func RefreshToken(req TokenRequest) (*dbTypes.OAuthLogin, *dbTypes.User, error)

Types

type TokenRequest

type TokenRequest struct {
	GrantType    string   `form:"grant_type" json:"grant_type"`
	ClientID     string   `form:"client_id" json:"client_id"`
	ClientSecret string   `form:"client_secret" json:"client_secret"`
	RefreshToken string   `form:"refresh_token" json:"refresh_token"`
	Code         string   `form:"code" json:"code"`
	RedirectURI  string   `form:"redirect_uri" json:"redirect_uri"`
	CodeVerifier string   `form:"code_verifier" json:"code_verifier"`
	ResponseType string   `form:"response_type" json:"response_type"`
	Scope        []string `form:"scope" json:"scope"`
}

Jump to

Keyboard shortcuts

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