hydra

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrChallengeMissed is an error that happens when a challenge is missed.
	ErrChallengeMissed = errors.New("challenge missed")
	// ErrUnauthenticated is an error that happens when authentication is failed.
	ErrUnauthenticated = errors.New("unauthenticated")
	// ErrChallengeNotFound is an error that happens when an unknown challenge is used.
	ErrChallengeNotFound = errors.New("challenge not found")
	// ErrChallengeExpired is an error that happens when a challenge is already used.
	ErrChallengeExpired = errors.New("challenge expired")
)

Functions

This section is empty.

Types

type ConsentReqDoer

type ConsentReqDoer struct {
	// contains filtered or unexported fields
}

ConsentReqDoer fetches information on the OAuth2 request and then accept or reject the requested authentication process.

func NewConsentReqDoer

func NewConsentReqDoer(hydraURL string, rememberFor int) *ConsentReqDoer

NewConsentReqDoer creates a ConsentRequest.

func (*ConsentReqDoer) AcceptConsentRequest

func (crd *ConsentReqDoer) AcceptConsentRequest(challenge string, remember bool, grantScope []string, idToken interface{}) (string, error)

AcceptConsentRequest accepts the requested authentication process, and returns redirect URI.

func (*ConsentReqDoer) InitiateRequest

func (crd *ConsentReqDoer) InitiateRequest(challenge string) (*ReqInfo, error)

InitiateRequest fetches information on the OAuth2 request.

type LoginReqDoer

type LoginReqDoer struct {
	// contains filtered or unexported fields
}

LoginReqDoer fetches information on the OAuth2 request and then accept or reject the requested authentication process.

func NewLoginReqDoer

func NewLoginReqDoer(hydraURL string, rememberFor int) *LoginReqDoer

NewLoginReqDoer creates a LoginRequest.

func (*LoginReqDoer) AcceptLoginRequest

func (lrd *LoginReqDoer) AcceptLoginRequest(challenge string, remember bool, subject string) (string, error)

AcceptLoginRequest accepts the requested authentication process, and returns redirect URI.

func (*LoginReqDoer) InitiateRequest

func (lrd *LoginReqDoer) InitiateRequest(challenge string) (*ReqInfo, error)

InitiateRequest fetches information on the OAuth2 request.

type LogoutReqDoer

type LogoutReqDoer struct {
	// contains filtered or unexported fields
}

LogoutReqDoer fetches information on the OAuth2 request and then accepts or rejects the requested logout process.

func NewLogoutReqDoer

func NewLogoutReqDoer(hydraURL string) *LogoutReqDoer

NewLogoutReqDoer creates a LogoutRequest.

func (*LogoutReqDoer) AcceptLogoutRequest

func (lrd *LogoutReqDoer) AcceptLogoutRequest(challenge string) (string, error)

AcceptLogoutRequest accepts the requested logout process, and returns redirect URI.

func (*LogoutReqDoer) InitiateRequest

func (lrd *LogoutReqDoer) InitiateRequest(challenge string) (*ReqInfo, error)

InitiateRequest fetches information on the OAuth2 request.

type ReqInfo

type ReqInfo struct {
	Challenge       string   `json:"challenge"`
	RequestedScopes []string `json:"requested_scope"`
	Skip            bool     `json:"skip"`
	Subject         string   `json:"subject"`
}

ReqInfo contains information on an ongoing login or consent request.

Jump to

Keyboard shortcuts

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