Constructor and Description |
---|
OAuthResult(MobileKitException mobileKitException)
Returns a new OAuthResult in case an error was returned
|
OAuthResult(java.lang.String accessToken,
java.lang.String tokenType,
java.lang.String refreshToken,
java.util.Date expiresOn,
java.lang.String scope,
java.util.Map<java.lang.String,java.lang.String> additionalData)
Returns a new OAuthResult with tokenType, accessToken, refreshToken
scope and expiresOn
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorDescription()
Returns detailed information about the error.
|
MobileKitException |
getMobileKitException()
Returns the exception.
|
boolean |
hasError()
Returns wheter to indicate an error.
|
static OAuthResult |
parse(org.json.JSONObject data)
Returns an instance of
OAuthResult parsed from the object. |
org.json.JSONObject |
serializeToJson()
Returns a JSON string of the serialized
OAuthResult object. |
OAuthToken |
serializeToToken()
Returns an
OAuthToken of the serialized object. |
public OAuthResult(MobileKitException mobileKitException)
mobileKitException
- the exception that was thrownpublic OAuthResult(java.lang.String accessToken, java.lang.String tokenType, java.lang.String refreshToken, java.util.Date expiresOn, java.lang.String scope, java.util.Map<java.lang.String,java.lang.String> additionalData)
accessToken
- the access token issued by the authorization servertokenType
- the type of token issuedrefreshToken
- the refresh token, which can be used to obtain new access tokens using
the same authorization grantexpiresOn
- the time and date when the access token is going to expirescope
- the scope that the token has authorizedadditionalData
- the dictionary of additional OAuth
attributespublic org.json.JSONObject serializeToJson()
OAuthResult
object.public OAuthToken serializeToToken()
OAuthToken
of the serialized object. The function returns null
if an error is present.OAuthToken
or null if an error is presentpublic static OAuthResult parse(org.json.JSONObject data)
OAuthResult
parsed from the object.
A MobileKitException
instance is added to the result if:
data
contains an ERROR
stringdata
is nulldata
can not be parseddata
itself is available via MobileKitException.getProperties()
.data
- the json object to deserialize fromOAuthResult
public boolean hasError()
public java.lang.String getErrorDescription()
getErrorDescription
in interface IResult
public MobileKitException getMobileKitException()
getMobileKitException
in interface IResult