simple

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SESSION_STATE_KEY = "oauthStateString"

Variables

This section is empty.

Functions

func Authorize

func Authorize(ctx *fiber.Ctx) error

func Callback

func Callback(ctx *fiber.Ctx) error

func GenOAuthState

func GenOAuthState(ctx *fiber.Ctx) (string, *common.Result)

func GetOAuthState

func GetOAuthState(ctx *fiber.Ctx) (string, *common.Result)

func GetUser

func GetUser(token string) *common.Result

func Middleware

func Middleware(ctx *fiber.Ctx) error

Types

type Config

type Config struct {
	AuthURL      string
	TokenURL     string
	UserURL      string
	CallbackURL  string
	ClientID     string
	ClientSecret string
}

type User

type User struct {
	AccessToken  string `json:"AccessToken"`
	RefreshToken string `json:"RefreshToken"`
	ExpiresIn    int    `json:"ExpiresIn"`
	Scope        string `json:"Scope"`
	Raw          struct {
		ID        string    `json:"Id"`
		ClientID  string    `json:"ClientId"`
		Username  string    `json:"Username"`
		EMail     string    `json:"EMail"`
		Mobile    string    `json:"Mobile"`
		CreatedAt time.Time `json:"CreatedAt"`
	} `json:"UserData"`
}

Jump to

Keyboard shortcuts

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