fosite: github.com/ory/fosite/handler/openid Index | Files

package openid

import "github.com/ory/fosite/handler/openid"

Index

Package Files

errors.go flow_explicit_auth.go flow_explicit_token.go flow_hybrid.go flow_implicit.go flow_refresh_token.go helper.go storage.go strategy.go strategy_jwt.go validator.go

Variables

var (
    ErrInvalidSession = errors.New("Session type mismatch")
)
var ErrNoSessionFound = fosite.ErrNotFound

type DefaultSession Uses

type DefaultSession struct {
    Claims    *jwt.IDTokenClaims
    Headers   *jwt.Headers
    ExpiresAt map[fosite.TokenType]time.Time
    Username  string
    Subject   string
}

IDTokenSession is a session container for the id token

func NewDefaultSession Uses

func NewDefaultSession() *DefaultSession

func (*DefaultSession) Clone Uses

func (s *DefaultSession) Clone() fosite.Session

func (*DefaultSession) GetExpiresAt Uses

func (s *DefaultSession) GetExpiresAt(key fosite.TokenType) time.Time

func (*DefaultSession) GetSubject Uses

func (s *DefaultSession) GetSubject() string

func (*DefaultSession) GetUsername Uses

func (s *DefaultSession) GetUsername() string

func (*DefaultSession) IDTokenClaims Uses

func (s *DefaultSession) IDTokenClaims() *jwt.IDTokenClaims

func (*DefaultSession) IDTokenHeaders Uses

func (s *DefaultSession) IDTokenHeaders() *jwt.Headers

func (*DefaultSession) SetExpiresAt Uses

func (s *DefaultSession) SetExpiresAt(key fosite.TokenType, exp time.Time)

type DefaultStrategy Uses

type DefaultStrategy struct {
    jwt.JWTStrategy

    Expiry time.Duration
    Issuer string
}

func (DefaultStrategy) GenerateIDToken Uses

func (h DefaultStrategy) GenerateIDToken(ctx context.Context, requester fosite.Requester) (token string, err error)

type IDTokenHandleHelper Uses

type IDTokenHandleHelper struct {
    IDTokenStrategy OpenIDConnectTokenStrategy
}

func (*IDTokenHandleHelper) GetAccessTokenHash Uses

func (i *IDTokenHandleHelper) GetAccessTokenHash(ctx context.Context, requester fosite.AccessRequester, responder fosite.AccessResponder) string

func (*IDTokenHandleHelper) IssueExplicitIDToken Uses

func (i *IDTokenHandleHelper) IssueExplicitIDToken(ctx context.Context, ar fosite.Requester, resp fosite.AccessResponder) error

func (*IDTokenHandleHelper) IssueImplicitIDToken Uses

func (i *IDTokenHandleHelper) IssueImplicitIDToken(ctx context.Context, ar fosite.Requester, resp fosite.AuthorizeResponder) error

type OpenIDConnectExplicitHandler Uses

type OpenIDConnectExplicitHandler struct {
    // OpenIDConnectRequestStorage is the storage for open id connect sessions.
    OpenIDConnectRequestStorage   OpenIDConnectRequestStorage
    OpenIDConnectRequestValidator *OpenIDConnectRequestValidator

    *IDTokenHandleHelper
}

func (*OpenIDConnectExplicitHandler) HandleAuthorizeEndpointRequest Uses

func (c *OpenIDConnectExplicitHandler) HandleAuthorizeEndpointRequest(ctx context.Context, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error

func (*OpenIDConnectExplicitHandler) HandleTokenEndpointRequest Uses

func (c *OpenIDConnectExplicitHandler) HandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) error

func (*OpenIDConnectExplicitHandler) PopulateTokenEndpointResponse Uses

func (c *OpenIDConnectExplicitHandler) PopulateTokenEndpointResponse(ctx context.Context, requester fosite.AccessRequester, responder fosite.AccessResponder) error

type OpenIDConnectHybridHandler Uses

type OpenIDConnectHybridHandler struct {
    AuthorizeImplicitGrantTypeHandler *oauth2.AuthorizeImplicitGrantTypeHandler
    AuthorizeExplicitGrantHandler     *oauth2.AuthorizeExplicitGrantHandler
    IDTokenHandleHelper               *IDTokenHandleHelper
    ScopeStrategy                     fosite.ScopeStrategy
    OpenIDConnectRequestValidator     *OpenIDConnectRequestValidator
    OpenIDConnectRequestStorage       OpenIDConnectRequestStorage

    Enigma *jwt.RS256JWTStrategy
}

func (*OpenIDConnectHybridHandler) HandleAuthorizeEndpointRequest Uses

func (c *OpenIDConnectHybridHandler) HandleAuthorizeEndpointRequest(ctx context.Context, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error

type OpenIDConnectImplicitHandler Uses

type OpenIDConnectImplicitHandler struct {
    AuthorizeImplicitGrantTypeHandler *oauth2.AuthorizeImplicitGrantTypeHandler
    *IDTokenHandleHelper
    ScopeStrategy                 fosite.ScopeStrategy
    OpenIDConnectRequestValidator *OpenIDConnectRequestValidator

    RS256JWTStrategy *jwt.RS256JWTStrategy
}

func (*OpenIDConnectImplicitHandler) HandleAuthorizeEndpointRequest Uses

func (c *OpenIDConnectImplicitHandler) HandleAuthorizeEndpointRequest(ctx context.Context, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error

type OpenIDConnectRefreshHandler Uses

type OpenIDConnectRefreshHandler struct {
    *IDTokenHandleHelper
}

func (*OpenIDConnectRefreshHandler) HandleTokenEndpointRequest Uses

func (c *OpenIDConnectRefreshHandler) HandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) error

func (*OpenIDConnectRefreshHandler) PopulateTokenEndpointResponse Uses

func (c *OpenIDConnectRefreshHandler) PopulateTokenEndpointResponse(ctx context.Context, requester fosite.AccessRequester, responder fosite.AccessResponder) error

type OpenIDConnectRequestStorage Uses

type OpenIDConnectRequestStorage interface {
    // CreateOpenIDConnectSession creates an open id connect session
    // for a given authorize code. This is relevant for explicit open id connect flow.
    CreateOpenIDConnectSession(ctx context.Context, authorizeCode string, requester fosite.Requester) error

    // IsOpenIDConnectSession returns error
    // - nil if a session was found,
    // - ErrNoSessionFound if no session was found
    // - or an arbitrary error if an error occurred.
    GetOpenIDConnectSession(ctx context.Context, authorizeCode string, requester fosite.Requester) (fosite.Requester, error)

    // DeleteOpenIDConnectSession removes an open id connect session from the store.
    DeleteOpenIDConnectSession(ctx context.Context, authorizeCode string) error
}

type OpenIDConnectRequestValidator Uses

type OpenIDConnectRequestValidator struct {
    AllowedPrompt []string
    Strategy      jwt.JWTStrategy
}

func NewOpenIDConnectRequestValidator Uses

func NewOpenIDConnectRequestValidator(prompt []string, strategy jwt.JWTStrategy) *OpenIDConnectRequestValidator

func (*OpenIDConnectRequestValidator) ValidatePrompt Uses

func (v *OpenIDConnectRequestValidator) ValidatePrompt(ctx context.Context, req fosite.AuthorizeRequester) error

type OpenIDConnectTokenStrategy Uses

type OpenIDConnectTokenStrategy interface {
    GenerateIDToken(ctx context.Context, requester fosite.Requester) (token string, err error)
}

type Session Uses

type Session interface {
    IDTokenClaims() *jwt.IDTokenClaims
    IDTokenHeaders() *jwt.Headers

    fosite.Session
}

Package openid imports 15 packages (graph) and is imported by 37 packages. Updated 2019-05-01. Refresh now. Tools for package owners.