Package org.mockserver.oidc
Class OidcDiscoveryCallback
java.lang.Object
org.mockserver.oidc.OidcDiscoveryCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Serves the OIDC discovery document (
/.well-known/openid-configuration).
A class callback rather than a static response so the issuer — and every endpoint URL
derived from it — is resolved per request by OidcIssuerResolver. OIDC Discovery
§4.3 requires the advertised issuer to match the URL the relying party fetched the document from;
baking a fixed http://localhost:1080 at generate time broke every client running the mock
on a random port (Testcontainers), which is the most common deployment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Constructor Details
-
OidcDiscoveryCallback
public OidcDiscoveryCallback()
-
-
Method Details
-
handle
Description copied from interface:ExpectationResponseCallbackCalled for every request when expectation condition has been satisfied. The request that satisfied the expectation condition is passed as the parameter and the return value is the request that will be returned.- Specified by:
handlein interfaceExpectationCallback<HttpResponse>- Specified by:
handlein interfaceExpectationResponseCallback- Parameters:
request- the request that satisfied the expectation condition- Returns:
- the response that will be returned
-