Class OAuthFlowException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.rest.auth.oauth.flow.OAuthFlowException
All Implemented Interfaces:
Serializable

Runtime exception thrown by any OAuth flow helper when the IdP rejects the request, the HTTP round-trip fails, or the response can't be parsed.

Unchecked because flow acquisition is typically called from startup or service-initialization code where checked exceptions would bloat call sites.

Since:
10.0.0
See Also:
  • Constructor Details

    • OAuthFlowException

      Constructor.
      Parameters:
      msg - The detail message. May be null.
    • OAuthFlowException

      public OAuthFlowException(String msg, Throwable cause)
      Constructor.
      Parameters:
      msg - The detail message. May be null.
      cause - The cause. May be null.
    • OAuthFlowException

      public OAuthFlowException(String msg, String errorCode)
      Constructor carrying the OAuth error code returned by the IdP (RFC 6749 §5.2).
      Parameters:
      msg - The detail message. May be null.
      errorCode - The OAuth error code (e.g. "invalid_grant"). May be null.
  • Method Details

    • errorCode

      Returns the OAuth error code the IdP returned, if this exception represents a token-endpoint error response (RFC 6749 §5.2).
      Returns:
      The error code (e.g. "invalid_grant"), or Optional.empty() if not an IdP error response.