Package org.mockserver.oidc
Class OidcKeyProvider
java.lang.Object
org.mockserver.oidc.OidcKeyProvider
Resolves the
AsymmetricKeyPair that an OIDC provider signs tokens with and publishes via
its JWKS endpoint.
Resolution order:
- If
jwkJsonis supplied — parse the JWK (which carries both key material and, when present, itskidand algorithm). - If
privateKeyPemis supplied — parse the private key; derive the public key fromcertificatePemwhen present, otherwise from the RSA private key's CRT parameters. - Otherwise — generate a fresh key pair for
signingAlgorithm.
Whatever the source, the resulting key pair's algorithm matches the configured
signingAlgorithm so the same key both signs tokens and is published in the JWKS — keeping
the sign/publish invariant intact. A supplied keyId (or the JWK's own kid) gives a
stable kid across restarts so JWKS-caching clients keep working; otherwise a random
kid is generated.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OidcKeyProvider
public OidcKeyProvider()
-
-
Method Details
-
resolveKeyPair
-