oauth2

package
v0.0.0-...-e62b3d3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsentChallengeKey = "consent.challenge"
	ConsentEndpointKey  = "consent.endpoint"
)
View Source
const (
	OpenIDConnectKeyName = "hydra.openid.connect"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsentStrategy

type ConsentStrategy interface {
	ValidateResponse(authorizeRequest fosite.AuthorizeRequester, token string) (claims *Session, err error)
	IssueChallenge(authorizeRequest fosite.AuthorizeRequester, redirectURL string) (token string, err error)
}

type DefaultConsentStrategy

type DefaultConsentStrategy struct {
	Issuer string

	KeyManager jwk.Manager
}

func (*DefaultConsentStrategy) IssueChallenge

func (s *DefaultConsentStrategy) IssueChallenge(authorizeRequest fosite.AuthorizeRequester, redirectURL string) (string, error)

func (*DefaultConsentStrategy) ValidateResponse

func (s *DefaultConsentStrategy) ValidateResponse(a fosite.AuthorizeRequester, token string) (claims *Session, err error)

type Handler

type Handler struct {
	OAuth2  fosite.OAuth2Provider
	Consent ConsentStrategy

	ConsentURL url.URL
}

func (*Handler) AuthHandler

func (o *Handler) AuthHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Handler) SetRoutes

func (h *Handler) SetRoutes(r *httprouter.Router)

func (*Handler) TokenHandler

func (o *Handler) TokenHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

type Session

type Session struct {
	Subject                  string `json:"sub"`
	*strategy.DefaultSession `json:"idToken"`
}

Jump to

Keyboard shortcuts

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