Package com.google.auth.oauth2
Class ExecutableResponse
- java.lang.Object
-
- com.google.auth.oauth2.ExecutableResponse
-
class ExecutableResponse extends java.lang.Object
Encapsulates response values for the 3rd party executable response (e.g. OIDC, SAML, error responses).
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
errorCode
private java.lang.String
errorMessage
private java.lang.Long
expirationTime
private static java.lang.String
SAML_SUBJECT_TOKEN_TYPE
private java.lang.String
subjectToken
private boolean
success
private java.lang.String
tokenType
private int
version
-
Constructor Summary
Constructors Constructor Description ExecutableResponse(com.google.api.client.json.GenericJson json)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.String
getErrorCode()
Returns the error code if the execution was unsuccessful, null otherwise.(package private) java.lang.String
getErrorMessage()
Returns the error message if the execution was unsuccessful, null otherwise.(package private) java.lang.Long
getExpirationTime()
Returns the subject token expiration time in seconds (Unix epoch time).(package private) java.lang.String
getSubjectToken()
Returns the subject token if the execution was successful, null otherwise.(package private) java.lang.String
getTokenType()
Returns the 3rd party subject token type.(package private) int
getVersion()
Returns the version of the executable output.(package private) boolean
isExpired()
Returns true if the subject token is expired, false otherwise.(package private) boolean
isSuccessful()
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(java.lang.Object field)
private static long
parseLongField(java.lang.Object field)
-
-
-
Field Detail
-
SAML_SUBJECT_TOKEN_TYPE
private static final java.lang.String SAML_SUBJECT_TOKEN_TYPE
- See Also:
- Constant Field Values
-
version
private final int version
-
success
private final boolean success
-
expirationTime
@Nullable private java.lang.Long expirationTime
-
tokenType
@Nullable private java.lang.String tokenType
-
subjectToken
@Nullable private java.lang.String subjectToken
-
errorCode
@Nullable private java.lang.String errorCode
-
errorMessage
@Nullable private java.lang.String errorMessage
-
-
Method Detail
-
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 java.lang.Long getExpirationTime()
Returns the subject token expiration time in seconds (Unix epoch time).
-
getTokenType
@Nullable java.lang.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 java.lang.String getSubjectToken()
Returns the subject token if the execution was successful, null otherwise.
-
getErrorCode
@Nullable java.lang.String getErrorCode()
Returns the error code if the execution was unsuccessful, null otherwise.
-
getErrorMessage
@Nullable java.lang.String getErrorMessage()
Returns the error message if the execution was unsuccessful, null otherwise.
-
parseIntField
private static int parseIntField(java.lang.Object field)
-
parseLongField
private static long parseLongField(java.lang.Object field)
-
-