Class OAuthIntrospectionValidator

java.lang.Object
org.apache.juneau.rest.server.auth.oauth.OAuthIntrospectionValidator
All Implemented Interfaces:
TokenValidator

public class OAuthIntrospectionValidator extends Object implements TokenValidator
TokenValidator that validates opaque OAuth 2.0 access tokens via the RFC 7662 Token Introspection endpoint.

Wraps Nimbus's TokenIntrospectionRequest / TokenIntrospectionResponse for the HTTP round-trip and the JSON parsing. A TokenCache (default: bounded LRU cache) short-circuits the round-trip on repeated lookups within the configured TTL window.

Usage

var validator = OAuthIntrospectionValidator.create() .introspectionEndpoint(URI.create("https://idp.example.com/oauth2/introspect")) .clientId("api-server") .clientSecret("...") .requiredScopes("read:orders") .build();

Defaults
  • Cache TTL: 5 minutes, capped at 1 hour.
  • Cache size: 1000 entries.
  • Required scopes: none (scope enforcement lives on the validator, not the filter).
See Also:
Since:
10.0.0