auth

package
v0.0.0-...-9f5186d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJWTTokenFromUserInfo

func BuildJWTTokenFromUserInfo(userInfo *UserInfo) (string, error)

func NewAuthMiddlewareHandler

func NewAuthMiddlewareHandler(next http.Handler) http.Handler

func NewHandler

func NewHandler() http.Handler

Types

type UserInfo

type UserInfo struct {
	Email         string `json:"email"`
	VerifiedEmail bool   `json:"verified_email"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
}
{
	"id": "114414239244661840729",
	"email": "tiaanl@gmail.com",
	"verified_email": true,
	"name": "Tiaan Louw",
	"given_name": "Tiaan",
	"family_name": "Louw",
	"link": "https://plus.google.com/114414239244661840729",
	"picture": "https://lh3.googleusercontent.com/-gSdVG5e0RsA/AAAAAAAAAAI/AAAAAAAABRs/oNHea8FPOo0/photo.jpg",
	"gender": "male",
	"locale": "en-GB"
}

func GetUserInfoFromGogole

func GetUserInfoFromGogole(token string) (*UserInfo, error)

func GetUserInfoFromJWTToken

func GetUserInfoFromJWTToken(bearerToken string) (*UserInfo, error)

Jump to

Keyboard shortcuts

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