Version: v0.0.0-...-50ba6b2 Latest Latest

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

Go to latest
Published: May 7, 2019 License: MIT Imports: 11 Imported by: 0




This section is empty.


View Source
var UserInfoURL = ""


This section is empty.


type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	AuthorizeURL     string
	TokenURL         string
	RedirectURL      string
	Scopes           []string
	AuthorizeHandler func(context *auth.Context) (*claims.Claims, error)

Config google Config

type GoogleProvider

type GoogleProvider struct {

GoogleProvider provide login with google method

func New

func New(config *Config) *GoogleProvider

func (GoogleProvider) Callback

func (provider GoogleProvider) Callback(context *auth.Context)

Callback implement Callback with google provider

func (GoogleProvider) ConfigAuth

func (provider GoogleProvider) ConfigAuth(*auth.Auth)

ConfigAuth config auth

func (GoogleProvider) GetName

func (GoogleProvider) GetName() string

GetName return provider name

func (GoogleProvider) Login

func (provider GoogleProvider) Login(context *auth.Context)

Login implemented login with google provider

func (GoogleProvider) Logout

func (GoogleProvider) Logout(context *auth.Context)

Logout implemented logout with google provider

func (GoogleProvider) OAuthConfig

func (provider GoogleProvider) OAuthConfig(context *auth.Context) *oauth2.Config

OAuthConfig return oauth config based on configuration

func (GoogleProvider) Register

func (provider GoogleProvider) Register(context *auth.Context)

Register implemented register with google provider

func (GoogleProvider) ServeHTTP

func (GoogleProvider) ServeHTTP(*auth.Context)

ServeHTTP implement ServeHTTP with google provider

type UserInfo

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

UserInfo google user info structure

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL