Class ExecutableResponse

java.lang.Object
com.google.auth.oauth2.ExecutableResponse

class ExecutableResponse extends Object
Encapsulates response values for the 3rd party executable response (e.g. OIDC, SAML, error responses).
  • Field Details

  • Constructor Details

    • ExecutableResponse

      ExecutableResponse(com.google.api.client.json.GenericJson json) throws IOException
      Throws:
      IOException
  • Method Details

    • getVersion

      int getVersion()
      Returns the version of the executable output. Only version `1` is currently supported. This is useful for future changes to the expected output format.
      Returns:
      The version of the JSON output.
    • isSuccessful

      boolean isSuccessful()
      Returns the status of the response.

      When this is true, the response will contain the 3rd party token for a sign in / refresh operation. When this is false, the response should contain an additional error code and message.

      Returns:
      Whether the `success` field in the executable response is true.
    • isExpired

      boolean isExpired()
      Returns true if the subject token is expired, false otherwise.
    • isValid

      boolean isValid()
      Returns whether the execution was successful and returned an unexpired token.
    • getExpirationTime

      @Nullable Long getExpirationTime()
      Returns the subject token expiration time in seconds (Unix epoch time).
    • getTokenType

      @Nullable String getTokenType()
      Returns the 3rd party subject token type.

      Possible valid values:

      • urn:ietf:params:oauth:token-type:id_token
      • urn:ietf:params:oauth:token-type:jwt
      • urn:ietf:params:oauth:token-type:saml2
      Returns:
      The 3rd party subject token type for success responses, null otherwise.
    • getSubjectToken

      @Nullable String getSubjectToken()
      Returns the subject token if the execution was successful, null otherwise.
    • getErrorCode

      @Nullable String getErrorCode()
      Returns the error code if the execution was unsuccessful, null otherwise.
    • getErrorMessage

      @Nullable String getErrorMessage()
      Returns the error message if the execution was unsuccessful, null otherwise.
    • parseIntField

      private static int parseIntField(Object field)
    • parseLongField

      private static long parseLongField(Object field)