Documentation
¶
Overview ¶
Package oidctest is a fake OpenID Connect provider for tests: discovery, JWKS, an authorize endpoint that signs the configured user in at once, and a token endpoint that checks the client secret and PKCE and issues RS256 ID tokens. Tests rotate keys and break tokens on purpose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider struct {
Issuer string
ClientID, ClientSecret string
// Authorizations counts authorize requests.
Authorizations int
// LastChallenge is the PKCE challenge of the last authorize request.
LastChallenge string
// contains filtered or unexported fields
}
Provider is a running fake provider.
func New ¶
New starts a provider with one signing key and the user sub-1 / alice@acme.test (verified).
func (*Provider) BadSignature ¶
BadSignature makes later ID tokens carry a signature by an unpublished key under the published kid.
func (*Provider) Rotate ¶
Rotate publishes a new signing key; the old one stays published when keepOld is set (the usual overlap), otherwise it is dropped.