Documentation ¶
Index ¶
Constants ¶
View Source
const (
ScopeAll = "all"
)
Scopes
Variables ¶
View Source
var ( ErrNotAuthorized = errors.New("not authorized") ErrInvalidClient = errors.New("invalid client") ErrInvalidAuth = errors.New("invalid auth") ErrMissingRedirect = errors.New("missing redirect_uri") ErrInvalidResponseType = errors.New("response_type unsupported") )
Error Values
Functions ¶
This section is empty.
Types ¶
type OAuthHandler ¶ added in v0.1.0
type OAuthHandler struct {
// contains filtered or unexported fields
}
OAuthHandler provides OAuth2 capabilities.
func NewHandler ¶
func NewHandler(options *Options) (*OAuthHandler, error)
NewHandler creates and initializes a new OAuthHandler
func (*OAuthHandler) Authorized ¶ added in v0.1.0
func (h *OAuthHandler) Authorized(r *http.Request) ([]string, error)
Authorized returns the authorized scopes for a request, or an error if the request does not have sufficient authorization.
func (*OAuthHandler) IsAuthenticated ¶ added in v0.1.0
func (h *OAuthHandler) IsAuthenticated(r *http.Request) string
IsAuthenticated checks the request for a Bearer token
func (*OAuthHandler) RegisterAPI ¶ added in v0.1.0
func (h *OAuthHandler) RegisterAPI(root string) *mux.Router
RegisterAPI returns a router that handles OAuth routes.
Click to show internal directories.
Click to hide internal directories.