Documentation ¶
Index ¶
- Constants
- Variables
- func APIKeyValidatorMiddleware(apiKeyMgr apikeymanager.APIKeyManager) func(http.Handler) http.Handler
- func MockOAuth2Server() *http.Server
- type IdToken
- type Idp
- func (idp *Idp) CheckUserAuthorization(email string) error
- func (idp *Idp) HandleSignInCallback(w http.ResponseWriter, r *http.Request)
- func (idp *Idp) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (idp *Idp) RedirectIfLoggedIn(next http.Handler) http.Handler
- func (idp *Idp) RequestSignIn(w http.ResponseWriter, r *http.Request)
- func (idp *Idp) RequireAuthentication(next http.Handler) http.Handler
- type LoginPromptData
- type OAuth2ClientConfig
Constants ¶
View Source
const (
LoginErrKey = "loginError"
)
Variables ¶
View Source
var ErrInvalidToken = errors.New("Invalid token")
Functions ¶
func APIKeyValidatorMiddleware ¶
func APIKeyValidatorMiddleware(apiKeyMgr apikeymanager.APIKeyManager) func(http.Handler) http.Handler
func MockOAuth2Server ¶
Types ¶
type Idp ¶
type Idp struct { oauth2.Config LoginPromptData LoginPromptData // contains filtered or unexported fields }
func NewIdp ¶
func NewIdp(config *OAuth2ClientConfig, sessionManager *scs.SessionManager) *Idp
func NewMockIdp ¶
func NewMockIdp(config *OAuth2ClientConfig, sessionManager *scs.SessionManager) *Idp
func (*Idp) CheckUserAuthorization ¶
CheckUserAuthorization checks if the user with the given email is authorized.
func (*Idp) HandleSignInCallback ¶
func (idp *Idp) HandleSignInCallback(w http.ResponseWriter, r *http.Request)
func (*Idp) LogoutHandler ¶
func (idp *Idp) LogoutHandler(w http.ResponseWriter, r *http.Request)
func (*Idp) RequestSignIn ¶
func (idp *Idp) RequestSignIn(w http.ResponseWriter, r *http.Request)
type LoginPromptData ¶
type OAuth2ClientConfig ¶
type OAuth2ClientConfig struct { ClientID string `mapstructure:"clientID"` ClientSecret string `mapstructure:"clientSecret"` RedirectURL string `mapstructure:"redirectURL"` AuthURL string `mapstructure:"authURL"` TokenURL string `mapstructure:"tokenURL"` Scopes []string Provider string `mapstructure:"provider"` AuthorizedDomains []string `mapstructure:"authorizedDomains"` Tenant string Domain string LoginText string }
Click to show internal directories.
Click to hide internal directories.