Package com.google.auth.oauth2
Class ExecutableResponse
java.lang.Object
com.google.auth.oauth2.ExecutableResponse
Encapsulates response values for the 3rd party executable response (e.g. OIDC, SAML, error
responses).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) String
Returns the error code if the execution was unsuccessful, null otherwise.(package private) String
Returns the error message if the execution was unsuccessful, null otherwise.(package private) Long
Returns the subject token expiration time in seconds (Unix epoch time).(package private) String
Returns the subject token if the execution was successful, null otherwise.(package private) String
Returns the 3rd party subject token type.(package private) int
Returns the version of the executable output.(package private) boolean
Returns true if the subject token is expired, false otherwise.(package private) boolean
Returns the status of the response.(package private) boolean
isValid()
Returns whether the execution was successful and returned an unexpired token.private static int
parseIntField
(Object field) private static long
parseLongField
(Object field)
-
Field Details
-
SAML_SUBJECT_TOKEN_TYPE
- See Also:
-
version
private final int version -
success
private final boolean success -
expirationTime
-
tokenType
-
subjectToken
-
errorCode
-
errorMessage
-
-
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
Returns the subject token expiration time in seconds (Unix epoch time). -
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
Returns the subject token if the execution was successful, null otherwise. -
getErrorCode
Returns the error code if the execution was unsuccessful, null otherwise. -
getErrorMessage
Returns the error message if the execution was unsuccessful, null otherwise. -
parseIntField
-
parseLongField
-