Class TokenRevokedException

All Implemented Interfaces:
Serializable

public final class TokenRevokedException extends AnkaSecureSdkException
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 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 to AnkaSecureSdkException's canonical constructor.
      Parameters:
      message - the detail message (server RFC 7807 detail when available)
      httpStatus - the HTTP status code (401)
      responseBody - the raw HTTP response body, if any
      cause - the underlying cause (may be null)
      context - additional diagnostic context key-value pairs
      errorCode - the classified SdkErrorCode
      retryAfterSeconds - the server Retry-After hint in seconds, or null