Documentation ¶
Index ¶
- Variables
- type Config
- type GoogleProvider
- func (provider GoogleProvider) Callback(context *auth.Context)
- func (provider GoogleProvider) ConfigAuth(*auth.Auth)
- func (GoogleProvider) GetName() string
- func (provider GoogleProvider) Login(context *auth.Context)
- func (GoogleProvider) Logout(context *auth.Context)
- func (provider GoogleProvider) OAuthConfig(context *auth.Context) *oauth2.Config
- func (provider GoogleProvider) Register(context *auth.Context)
- func (GoogleProvider) ServeHTTP(*auth.Context)
- type UserInfo
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) 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
Click to show internal directories.
Click to hide internal directories.