Class TokenIntrospectionClient
java.lang.Object
com.revetsec.oauth.TokenIntrospectionClient
- All Implemented Interfaces:
AccessTokenValidator
@ThreadSafe
public final class TokenIntrospectionClient
extends Object
implements AccessTokenValidator
Audience-checked RFC7662 JSON introspection using the supplied OAuth client settings.
No credential result is cached; an admitted validation performs its own single authenticated POST.
Endpoint health backoff can prevent that POST: 401/429 opens it immediately. Transport failures and
5xx responses count together; three within one cooldown window, measured from the first and with no
valid response in between, open it. Other client errors remain local to their request. Blocked callers receive fresh infrastructure exceptions, never
another request's endpoint rejection. A valid parsed response, including inactive, restores health.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfigures required audiences and optional introspection policy; OAuth settings are inherited. -
Method Summary
Modifier and TypeMethodDescriptiontoString()Returns a redacted description.validateResult(@NonNull BearerToken token) Returns a credential verdict or a distinct checked endpoint rejection.voidwarmUp()Warms role-specific discovery without sending a credential.withOAuthClient(@NonNull OAuthClient client) Starts introspection with one configured confidential authentication strategy.
-
Method Details
-
withOAuthClient
public static @NonNull TokenIntrospectionClient.Builder withOAuthClient(@NonNull OAuthClient client) Starts introspection with one configured confidential authentication strategy.- Parameters:
client- OAuth client supplying issuer, credentials, transport, clock and deadlines- Returns:
- builder
- Since:
- 1.0.0
-
warmUp
-
validateResult
@CheckReturnValue public @NonNull AccessTokenValidationResult validateResult(@NonNull BearerToken token) Returns a credential verdict or a distinct checked endpoint rejection. Transient provider failures, malformed responses, metadata failures and transport failures remain exceptions.- Specified by:
validateResultin interfaceAccessTokenValidator- Parameters:
token- unverified bearer credential- Returns:
- outcome
- Since:
- 1.0.0
-
toString
-