Package org.mockserver.oidc
Class OidcRevocationCallback
java.lang.Object
org.mockserver.oidc.OidcRevocationCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Mock OAuth2 token revocation endpoint (RFC 7009).
Records the presented token as revoked so OidcIntrospectionCallback subsequently
reports it inactive. Previously this endpoint returned a static 200 and did nothing, so a token
introspected as active:true immediately after being revoked — which made
"my application rejects a revoked token" a test that passes while proving nothing.
Per RFC 7009 §2.2 the endpoint returns 200 regardless of whether the token was recognised (an unknown token is already "not active", which is the requested outcome), so a client cannot use the revocation endpoint as a token oracle.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Constructor Details
-
OidcRevocationCallback
public OidcRevocationCallback()
-
-
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
-