auth

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AuthCookie             = "auth"
	AccessTokenKey         = "access-token"
	AuthorizationExtrasKey = "authorization-extras"
	EmailKey               = "email"
	NameKey                = "name"
	PictureKey             = "picture"
)

Variables

This section is empty.

Functions

func GetCurrentUser

func GetCurrentUser(c echo.Context) error

func SetUser

func SetUser(c echo.Context, user *User) error

func ValidateAuth

func ValidateAuth(c echo.Context, cfgProvider *config.ConfigProviderWithRefresh) error

func WithAuth

func WithAuth(c echo.Context) runtime.ServeMuxOption

Types

type Claims

type Claims struct {
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
}

type User

type User struct {
	OAuth2Token *oauth2.Token
	IDToken     *Claims
}

func ExchangeCode

func ExchangeCode(ctx context.Context, r *http.Request, config *oauth2.Config, provider *oidc.Provider) (*User, error)

Jump to

Keyboard shortcuts

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