security

package
v0.0.0-...-6481dc9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOOGLE_TOKENINFO_ENDPOINT = "https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=%s"
)
View Source
const (
	JWT_COOKIE_NAME = "merknerajwt"
)

Variables

This section is empty.

Functions

func NewJWTToken

func NewJWTToken(userId int) (string, error)

func ValidateToken

func ValidateToken(tokenStr string) (*jwt.Token, error)

Types

type LoginHandler

type LoginHandler struct{}

func (LoginHandler) ServeHTTP

func (l LoginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LogoutHandler

type LogoutHandler struct{}

func (LogoutHandler) ServeHTTP

func (l LogoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TokenInfoResponse

type TokenInfoResponse struct {
	Issuer             string `json:"iss"`
	Audience           string `json:"aud"`
	Subject            string `json:"sub"`
	Email              string `json:"email"`
	Name               string `json:"name"`
	Picture            string `json:"picture"`
	GivenName          string `json:"given_name"`
	FamilyName         string `json:"family_name"`
	IssuedAtUnix       string `json:"iat"`
	IssuedAt           time.Time
	ExpirationTimeUnix string `json:"exp"`
	ExpirationTime     time.Time
	ErrorDescription   string `json:"error_description"`
}

func ValidateGoogleIdToken

func ValidateGoogleIdToken(token string) (TokenInfoResponse, error)

Jump to

Keyboard shortcuts

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