auth

package
v0.0.0-...-8c31c7c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRedirectHandler

func AuthRedirectHandler() gin.HandlerFunc

func GetUser

func GetUser(ctx *gin.Context) *model.User

func Login

func Login(ctx *gin.Context, redirect string)

func LoginRequired

func LoginRequired(h gin.HandlerFunc) gin.HandlerFunc

func Logout

func Logout(ctx *gin.Context, redirect string)

func Setup

func Setup(redirectURL, clientId, clientSecret string, scopes []string, sessionExpireDuration time.Duration)

Setup the authorization path

func UserMiddleware

func UserMiddleware() gin.HandlerFunc

Types

type User

type User struct {
	Sub           string `json:"sub"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Profile       string `json:"profile"`
	Picture       string `json:"picture"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Gender        string `json:"gender"`
	Hd            string `json:"hd"`
}

User is a retrieved and authenticated user.

func (*User) FillUserInfo

func (gu *User) FillUserInfo(u *model.User) *model.User

Jump to

Keyboard shortcuts

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