Documentation ¶
Index ¶
- Constants
- func GetEmailsFromProvider(w http.ResponseWriter, r *http.Request, oh OAuth2Handler, bearer string) ([]string, error)
- func GetUserInfoURL(oh OAuth2Handler) (string, error)
- func GetUserSession(auth AuthHandler) http.HandlerFunc
- type AuthHandler
- type GithubUserInfo
- type GoogleUserInfo
- type OAuth2Handler
- type SessionInfo
Constants ¶
View Source
const ModifyEntryScope = "modify:entry"
View Source
const ReadMemberScope = "read:member"
View Source
const WriteEmailScope = "write:email"
View Source
const WriteImageScope = "write:image"
View Source
const WriteMemberScope = "write:member"
Variables ¶
This section is empty.
Functions ¶
func GetEmailsFromProvider ¶
func GetEmailsFromProvider(w http.ResponseWriter, r *http.Request, oh OAuth2Handler, bearer string) ([]string, error)
func GetUserInfoURL ¶
func GetUserInfoURL(oh OAuth2Handler) (string, error)
func GetUserSession ¶
func GetUserSession(auth AuthHandler) http.HandlerFunc
Types ¶
type AuthHandler ¶
type AuthHandler struct {
Store *sessions.CookieStore
}
func New ¶
func New() AuthHandler
func (AuthHandler) CheckScope ¶
func (a AuthHandler) CheckScope(router http.HandlerFunc, scope string) http.HandlerFunc
func (AuthHandler) ScopeOk ¶
func (auth AuthHandler) ScopeOk(w http.ResponseWriter, r *http.Request, scope string) bool
type GithubUserInfo ¶
type GoogleUserInfo ¶
type OAuth2Handler ¶
type OAuth2Handler struct { Provider string ClientID string ClientSecret string RedirectURL string Scopes []string }
func (OAuth2Handler) Oauth2CallbackHandler ¶
func (oh OAuth2Handler) Oauth2CallbackHandler(auth AuthHandler) http.HandlerFunc
func (OAuth2Handler) Oauth2RedirectHandler ¶
func (oh OAuth2Handler) Oauth2RedirectHandler(auth AuthHandler) http.HandlerFunc
func (OAuth2Handler) VerifyEmail ¶
func (oh OAuth2Handler) VerifyEmail(auth AuthHandler, db *sql.DB) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.