# Class OidcException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.codename1.io.oidc.OidcException

public class OidcException extends IOException
Thrown for failures during an OpenID Connect / OAuth 2.0 flow driven by `OidcClient`. The `getError()` code mirrors the `error` field from RFC 6749 for authorization-server responses (e.g. `"access_denied"`, `"invalid_grant"`) and uses Codename One-specific values for transport or client-side problems (`"transport_error"`, `"state_mismatch"`, `"nonce_mismatch"`, `"user_cancelled"`, `"discovery_failed"`, `"invalid_id_token"`).

Since:
  7.0.245

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ACCESS_DENIED`
  Authorization server returned `error=access_denied`.
  `static final String`
  `DISCOVERY_FAILED`
  The discovery document could not be fetched or parsed.
  `static final String`
  `INVALID_GRANT`
  Token-endpoint response was missing or malformed.
  `static final String`
  `INVALID_ID_TOKEN`
  ID token failed structural validation (we do not currently verify the signature -- treat the issuer as a trust anchor and use TLS to the discovery URL).
  `static final String`
  `NONCE_MISMATCH`
  `nonce` claim on the returned ID token did not match the one we sent.
  `static final String`
  `STATE_MISMATCH`
  `state` returned by the authorization server did not match the one we sent.
  `static final String`
  `TRANSPORT_ERROR`
  Generic transport / network failure.
  `static final String`
  `USER_CANCELLED`
  User cancelled the system browser / native sign-in sheet.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OidcException(String error, String message)`
  `OidcException(String error, String message, Throwable cause)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getError()`
  The short error code (see the constants on this class).
  `String`
  `getErrorDescription()`
  Human-readable description supplied by the server or the client.

  ### Methods inherited from class Throwable

  `addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### ACCESS_DENIED

    public static final String ACCESS_DENIED
    Authorization server returned `error=access_denied`.
    See Also:
      - Constant Field Values

  - ### USER_CANCELLED

    public static final String USER_CANCELLED
    User cancelled the system browser / native sign-in sheet.
    See Also:
      - Constant Field Values

  - ### STATE_MISMATCH

    public static final String STATE_MISMATCH
    `state` returned by the authorization server did not match the one we sent.
    See Also:
      - Constant Field Values

  - ### NONCE_MISMATCH

    public static final String NONCE_MISMATCH
    `nonce` claim on the returned ID token did not match the one we sent.
    See Also:
      - Constant Field Values

  - ### DISCOVERY_FAILED

    public static final String DISCOVERY_FAILED
    The discovery document could not be fetched or parsed.
    See Also:
      - Constant Field Values

  - ### INVALID_GRANT

    public static final String INVALID_GRANT
    Token-endpoint response was missing or malformed.
    See Also:
      - Constant Field Values

  - ### INVALID_ID_TOKEN

    public static final String INVALID_ID_TOKEN
    ID token failed structural validation (we do not currently verify the signature -- treat the issuer as a trust anchor and use TLS to the discovery URL).
    See Also:
      - Constant Field Values

  - ### TRANSPORT_ERROR

    public static final String TRANSPORT_ERROR
    Generic transport / network failure.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### OidcException

    public OidcException(String error, String message)

  - ### OidcException

    public OidcException(String error, String message, Throwable cause)

- ## Method Details

  - ### getError

    public String getError()
    The short error code (see the constants on this class).

  - ### getErrorDescription

    public String getErrorDescription()
    Human-readable description supplied by the server or the client.