google

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 13 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserInfoURL = "https://www.googleapis.com/oauth2/v3/userinfo"

Functions

This section is empty.

Types

type Config

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

Config google Config

type GoogleProvider

type GoogleProvider struct {
	*Config
}

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

Jump to

Keyboard shortcuts

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