Package org.mockserver.oidc
Class OidcIntrospectionCallback
java.lang.Object
org.mockserver.oidc.OidcIntrospectionCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Mock OIDC/OAuth2 introspection endpoint (RFC 7662).
The presented token form parameter is always validated — introspection is a security
control, so it fails closed:
- no
tokenparameter →400 invalid_request(RFC 7662 §2.1); - revoked token →
{"active":false}(RFC 7009); - known, unexpired opaque token →
{"active":true, ...claims}; - JWT token that verifies against the provider's signing key and is inside its validity
window →
{"active":true, ...claims from the token}; - anything else — garbage, expired, tampered, another provider's token →
{"active":false}and nothing else (RFC 7662 §2.2).
Behaviour change. This endpoint previously ignored the token entirely for JWT providers
(the default) and reported active from static configuration, so every string introspected as
active. Tests asserting that an application rejects an expired or revoked token passed while proving
nothing; such tests will now correctly fail if the application does not in fact reject them.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Constructor Details
-
OidcIntrospectionCallback
public OidcIntrospectionCallback()
-
-
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
-