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("...") .audience("https://api.example.com") .requiredScopes("read:orders") .build();

Defaults

See Also:

Since:
10.0.0