Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(provider Provider, state State, redirectUrl string, success handlers.AuthenticationSuccessHandler, error handlers.AuthenticationErrorHandler) (*Handler, error)
func (*Handler) AuthenticationError ¶
Implements oauth.handlers.AuthenticationHandler
func (*Handler) AuthenticationNeeded ¶
func (h *Handler) AuthenticationNeeded(w http.ResponseWriter, req *http.Request)
Implements oauth.handlers.AuthenticationHandler
type Provider ¶
type Provider interface { NewConfig() (*osincli.ClientConfig, error) AddCustomParameters(*osincli.AuthorizeRequest) GetUserInfo(*osincli.AccessData) (api.UserInfo, bool, error) }
Provider encapsulates the URLs, configuration, any custom authorize request parameters, and the method for transforming an access token into an identity, for an external OAuth provider.
type State ¶
type State interface { Generate(w http.ResponseWriter, req *http.Request) (string, error) Check(state string, w http.ResponseWriter, req *http.Request) (bool, error) }
State handles generating and verifying the state parameter round-tripped to an external OAuth flow. Examples: CSRF protection, post authentication redirection
func DefaultState ¶
func DefaultState() State
Click to show internal directories.
Click to hide internal directories.