Class TokenRevokedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
co.ankatech.ankasecure.sdk.exception.TokenRevokedException
- All Implemented Interfaces:
Serializable
Thrown when the server rejects a previously-issued access token with HTTP 401 on a data-plane
operation. The bound token is no longer accepted — it was revoked (logout / blacklist), superseded
by the subject's revocation epoch (a bulk revoke such as an admin force-reset, a suspend/delete, or
a role scope shrink), or expired. This is an honest, typed signal — distinct from a generic error —
that the caller must obtain a fresh token (re-authenticate via
AnkaSecureSdk) and retry.
Raised only for a 401 on an OPERATION request, i.e. after a successful authentication. A 401 at
authentication time (bad credentials) is reported by the factory and is NOT surfaced as this type.
Because it extends AnkaSecureSdkException, existing catch blocks keep working; callers that
want to react to token invalidation specifically catch this subtype.
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTokenRevokedException(String message, int httpStatus, String responseBody, Throwable cause, Map<String, String> context, SdkErrorCode errorCode, Long retryAfterSeconds) Constructs a token-revoked exception carrying the full HTTP diagnostic context, delegating toAnkaSecureSdkException's canonical constructor. -
Method Summary
Methods inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
getContext, getErrorCode, getHttpStatus, getResponseBody, getRetryAfterSecondsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TokenRevokedException
public TokenRevokedException(String message, int httpStatus, String responseBody, Throwable cause, Map<String, String> context, SdkErrorCode errorCode, Long retryAfterSeconds) Constructs a token-revoked exception carrying the full HTTP diagnostic context, delegating toAnkaSecureSdkException's canonical constructor.- Parameters:
message- the detail message (server RFC 7807detailwhen available)httpStatus- the HTTP status code (401)responseBody- the raw HTTP response body, if anycause- the underlying cause (may benull)context- additional diagnostic context key-value pairserrorCode- the classifiedSdkErrorCoderetryAfterSeconds- the serverRetry-Afterhint in seconds, ornull
-