Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth is used for the authentication handlers, and hold all the values needed for authentication.
func NewAuth ¶
func NewAuth(proto string, host string, port string, cookieStoreKey string, clientIDKey string, clientSecret string) (*Auth, *sessions.CookieStore)
NewAuth will return *auth and a *sessions.CookieStore, with a prepared OauthConfig and CookieStore set. proto, is either http or https, host, is the name of your sever, like example.com or localhost or..., port, for example :8080, cookieStoreKey, is the secret key used for the cookie storage, clientIDKey, is the Client ID key found in the google developer console for your oauth app, clientSecret, is the client secret found in the google developer console for your oauth app.
func (*Auth) IsAuthenticated ¶
func (a *Auth) IsAuthenticated(h http.HandlerFunc) http.HandlerFunc
IsAuthenticated is a wrapper to put around handlers you want to protect with an authenticated user.