Documentation ¶
Overview ¶
Package for handling challenge requests from Hydra(https://github.com/ory/hydra).
Index ¶
- Constants
- Variables
- func ClientInfoKey(clientID string) string
- type Challenge
- func (c *Challenge) Delete(w http.ResponseWriter, r *http.Request) error
- func (c *Challenge) GrantAccessToAll(w http.ResponseWriter, r *http.Request) error
- func (c *Challenge) RefuseAccess(w http.ResponseWriter, r *http.Request) error
- func (c *Challenge) Save(w http.ResponseWriter, r *http.Request) error
- func (c *Challenge) Update(w http.ResponseWriter, r *http.Request) error
- type IDP
- type IDPConfig
Constants ¶
View Source
const ( VerifyPublicKey = "VerifyPublic" ConsentPrivateKey = "ConsentPrivate" )
View Source
const (
SessionCookieName = "challenge"
)
Variables ¶
View Source
var ( ErrorBadPublicKey = errors.New("cannot convert to public key") ErrorBadPrivateKey = errors.New("cannot convert to private key") ErrorBadRequest = errors.New("bad request") ErrorBadChallengeCookie = errors.New("bad format of the challenge cookie") ErrorChallengeExpired = errors.New("challenge expired") ErrorNoSuchClient = errors.New("there's no OIDC Client with such id") ErrorBadKey = errors.New("bad key stored in the cache ") ErrorNotInCache = errors.New("cache doesn't have the requested data") ErrorBadSigningMethod = errors.New("bad signing method") ErrorInvalidToken = errors.New("invalid token") )
Functions ¶
func ClientInfoKey ¶
Types ¶
type Challenge ¶
type Challenge struct { // Hydra's client Client *hclient.Client // Time of expiration Expires time.Time // Unique JWT id JTI string // Redirect URL Redirect string // Requested scopes Scopes []string // Set in the challenge endpoint, after authenticated. User string // contains filtered or unexported fields }
func (*Challenge) GrantAccessToAll ¶
User granted access to requested scopes, forward the desicion to Hydra via redirection.
func (*Challenge) RefuseAccess ¶
User refused access to requested scopes, forward the desicion to Hydra via redirection.
type IDP ¶
type IDP struct {
// contains filtered or unexported fields
}
Identity Provider helper
func (*IDP) GetChallenge ¶
Get the Challenge from a cookie, using Gorilla sessions
type IDPConfig ¶
type IDPConfig struct { // Client id issued by Hydra ClientID string `yaml:"client_id"` // Client secret issued by Hydra ClientSecret string `yaml:"client_secret"` // Hydra's address ClusterURL string `yaml:"hydra_address"` // Expiration time of internal key cache KeyCacheExpiration time.Duration `yaml:"key_cache_expiration"` // Expiration time of internal clientid cache ClientCacheExpiration time.Duration `yaml:"client_cache_expiration"` // Internal cache cleanup interval CacheCleanupInterval time.Duration `yaml:"cache_cleanup_interval"` // Expiration time of internal clientid cache ChallengeExpiration time.Duration `yaml:"challenge_expiration"` // Gorilla sessions Store for storing the Challenge. ChallengeStore sessions.Store }
Identity Provider's options
Click to show internal directories.
Click to hide internal directories.