Documentation ¶
Overview ¶
Package mauth implements OAuth2 authentication for providers in github.com/markbates/goth/providers. It's largely based on github.com/markbates/goth/gothic, however, without global state.
Index ¶
- Variables
- type Provider
- type Providers
- type Sessions
- func (s *Sessions) BeginLogin(providerName string, w http.ResponseWriter, r *http.Request) (url string, _ error)
- func (s *Sessions) FinishLogin(providerName string, w http.ResponseWriter, r *http.Request) (User, error)
- func (s *Sessions) Logout(w http.ResponseWriter, r *http.Request) error
- func (s *Sessions) Providers() Providers
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidProvider is returned when an invalid provider is used in BeginLogin or FinishLogin. ErrInvalidProvider = errors.New("invalid provider") )
Functions ¶
This section is empty.
Types ¶
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
Sessions manages sessions for multiple goth.Provider-s.
func NewWithCookieStore ¶
NewWithCookieStore creates a new authentication manager that uses CookieStore with default name.
func (*Sessions) BeginLogin ¶
func (s *Sessions) BeginLogin(providerName string, w http.ResponseWriter, r *http.Request) (url string, _ error)
BeginLogin redirects request to provider OAuth login page.
If it returns error, it has not redirected the page.
func (*Sessions) FinishLogin ¶
func (s *Sessions) FinishLogin(providerName string, w http.ResponseWriter, r *http.Request) (User, error)
FinishLogin should be called as a callback after authentication.
Click to show internal directories.
Click to hide internal directories.