Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ProviderKey provides access to the Provider interface upon successful auth. ProviderKey = "provider" // ErrorKey provides access to the error message when auth fails. ErrorKey = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ClientID string ClientSecret string RedirectURL string SuccessHandler http.Handler ErrorHandler http.Handler }
Config stores configuration information for a specific provider.
type Facebook ¶
type Facebook struct {
// contains filtered or unexported fields
}
Facebook provides a Provider implementation for Facebook auth.
func NewFacebook ¶
func (*Facebook) CallbackHandler ¶
func (*Facebook) LoginHandler ¶
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
Google provides a Provider implementation for Google auth.
func (*Google) CallbackHandler ¶
func (*Google) LoginHandler ¶
type Provider ¶
type Provider interface { // Name returns a unique name for the provider. Name() string // LoginHandler returns an HTTP handler for beginning auth. LoginHandler() http.Handler // CallbackHandler returns an HTTP handler for completing auth. CallbackHandler() http.Handler // User returns information about the user. User(context.Context) (*User, error) }
Provider implements authentication for a specific provider.
Click to show internal directories.
Click to hide internal directories.