Class TokenAcquisitionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.backend.security.oauth2.client.credentials.TokenAcquisitionException

public class TokenAcquisitionException extends RuntimeException

A token endpoint did not issue a token.

The message names the endpoint, the HTTP status and the OAuth error code, and nothing else. The request carried a client secret or a signed assertion and the response may carry a token, so neither body is ever copied into it: this exception is written to logs and error pages by code that has no idea what it holds.

  • Constructor Details

    • TokenAcquisitionException

      public TokenAcquisitionException(String message, int status, String errorCode, boolean retryable, Throwable cause)
      Parameters:
      message - what failed, with no secret in it
      status - the HTTP status, or -1 when the endpoint was not reached
      errorCode - the OAuth error code the endpoint gave, or null
      retryable - whether trying again later can succeed
      cause - the failure underneath, or null
  • Method Details

    • getStatus

      public int getStatus()
      The HTTP status, or -1 when the endpoint was not reached.
    • getErrorCode

      public String getErrorCode()
      The OAuth error code, such as invalid_grant, or null.
    • isRetryable

      public boolean isRetryable()
      True for a failure that can go away by itself: the endpoint could not be reached, answered 5xx, or asked to slow down with 429. A refused credential (invalid_client, invalid_grant) is not.