Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoogleAuth ¶
type GoogleAuth struct {
// contains filtered or unexported fields
}
GoogleAuth is the Google authentication setup
func (*GoogleAuth) GetAndDelete ¶
func (a *GoogleAuth) GetAndDelete(state string) bool
GetAndDelete looks up an auth state and deletes it if found. If the auth state is found it returns true, otherwise it returns false.
func (*GoogleAuth) GoogleCallbackHandler ¶
func (a *GoogleAuth) GoogleCallbackHandler(w http.ResponseWriter, r *http.Request)
GoogleCallbackHandler handles the callback from Google
func (*GoogleAuth) GoogleLoginHandler ¶
func (a *GoogleAuth) GoogleLoginHandler(w http.ResponseWriter, r *http.Request)
GoogleLoginHandler handles the redirect to Google
func (*GoogleAuth) NewAuthState ¶
func (a *GoogleAuth) NewAuthState(r *http.Request) string
NewAuthState generates a new state string and stores it for future comparison
type GoogleAuthConfig ¶
type GoogleAuthConfig struct { ClientID string ClientSecret string CallbackURL string ErrorURL string Scopes []string LoginCallback LoginFunc }
GoogleAuthConfig represents the configuration for GoogleAuth
type LoginFunc ¶
type LoginFunc func(w http.ResponseWriter, r *http.Request, u *Userinfo)
LoginFunc is called when a user has successfully logged in
type Userinfo ¶
type Userinfo struct { ID string `json:"id"` Email string `json:"email"` VerifiedEmail bool `json:"verified_email"` Name string `json:"name"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` Picture string `json:"picture"` Locale string `json:"locale"` HostDomain string `json:"hd"` }
Userinfo contains the information we get from Google
Click to show internal directories.
Click to hide internal directories.