com.ibm.security.access.mobile.authentication

Class OAuthResult

  • java.lang.Object
    • com.ibm.security.access.mobile.authentication.OAuthResult
  • All Implemented Interfaces:
    IResult


    public final class OAuthResult
    extends java.lang.Object
    implements IResult
    Holds the result of the authentication request
    Since:
    1.0.0
    Version:
    1.2.8
    • Constructor Detail

      • OAuthResult

        public OAuthResult(MobileKitException mobileKitException)
        Returns a new OAuthResult in case an error was returned
        Parameters:
        mobileKitException - the exception that was thrown
      • OAuthResult

        public 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
        Parameters:
        accessToken - the access token issued by the authorization server
        tokenType - the type of token issued
        refreshToken - the refresh token, which can be used to obtain new access tokens using the same authorization grant
        expiresOn - the time and date when the access token is going to expire
        scope - the scope that the token has authorized
        additionalData - the dictionary of additional OAuth attributes
    • Method Detail

      • serializeToJson

        public org.json.JSONObject serializeToJson()
        Returns a JSON string of the serialized OAuthResult object.
        Returns:
        the JSONObject
      • serializeToToken

        public OAuthToken serializeToToken()
        Returns an OAuthToken of the serialized object. The function returns null if an error is present.
        Returns:
        serialized authentication result as an OAuthToken or null if an error is present
      • hasError

        public boolean hasError()
        Returns wheter to indicate an error.
        Returns:
        true if there has been an error,
        false otherwise
      • getErrorDescription

        public java.lang.String getErrorDescription()
        Returns detailed information about the error.
        Specified by:
        getErrorDescription in interface IResult
        Returns:
        the detailed information of the error or null if unknown.