Class OidcIntrospectionCallback

java.lang.Object
org.mockserver.oidc.OidcIntrospectionCallback
All Implemented Interfaces:
ExpectationCallback<HttpResponse>, ExpectationResponseCallback

public class OidcIntrospectionCallback extends Object implements 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 token parameter → 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 Details

    • OidcIntrospectionCallback

      public OidcIntrospectionCallback()
  • Method Details