passport

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: 10 Imported by: 0

Documentation

Overview

Package passport implements the OAuth2 protocol for authenticating users through passport.

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 {
	ID       int
	Name     string
	NickName string
	Email    string
	Token    string
}

Jump to

Keyboard shortcuts

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