external

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

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

func (h *Handler) AuthenticationError(err error, w http.ResponseWriter, req *http.Request)

Implements oauth.handlers.AuthenticationHandler

func (*Handler) AuthenticationNeeded

func (h *Handler) AuthenticationNeeded(w http.ResponseWriter, req *http.Request)

Implements oauth.handlers.AuthenticationHandler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

Handles the callback request in response to an external oauth flow

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL