Documentation ¶
Index ¶
- Variables
- func Facebook(config *Config) negroni.Handler
- func Github(config *Config) negroni.Handler
- func Google(config *Config) negroni.Handler
- func LinkedIn(config *Config) negroni.Handler
- func LoginRequired() negroni.HandlerFunc
- func NewOAuth2Provider(config *Config, authUrl, tokenUrl string) negroni.HandlerFunc
- func SetToken(r *http.Request, t interface{})
- type Config
- type Token
- type Tokens
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PathLogin sets the path to handle OAuth 2.0 logins. PathLogin = "/login" // PathLogout sets to handle OAuth 2.0 logouts. PathLogout = "/logout" // PathCallback sets the path to handle callback from OAuth 2.0 backend // to exchange credentials. PathCallback = "/oauth2callback" // PathError sets the path to handle error cases. PathError = "/oauth2error" )
Functions ¶
func LoginRequired ¶
func LoginRequired() negroni.HandlerFunc
Handler that redirects user to the login page if user is not logged in.
func NewOAuth2Provider ¶
func NewOAuth2Provider(config *Config, authUrl, tokenUrl string) negroni.HandlerFunc
Returns a generic OAuth 2.0 backend endpoint.
Types ¶
Click to show internal directories.
Click to hide internal directories.