OAuthResult

@objc
public final class OAuthResult : NSObject, ResultProtocol

Holds the result of the authentication request.

  • The type of error.

    Declaration

    Swift

    @objc
    public fileprivate(set) var error: Error?
  • The detailed information of the error.

    Declaration

    Swift

    @objc
    public var errorDescription: String? { get }
  • The flag to indicate an error.

    Declaration

    Swift

    @objc
    public var hasError: Bool { get }
  • Construct an instance containing the exception.

    Declaration

    Swift

    public init(error: Error)

    Parameters

    error

    An instance of the Error representing the error.

  • Parses the object into an OAuthResult.

    Throws

    IBMMobileKitError.serverError, IBMMobileKitError.invalidDataFromServer

    Declaration

    Swift

    open static func parse(_ data: [String : Any]) throws -> OAuthResult

    Parameters

    data

    The object to deserialize from.

    Return Value

    Deserialized OAuthResult.

  • Serialize the object to a JSON string.

    Declaration

    Swift

    @objc
    public func serializeToJson() -> String

    Return Value

    Serialized OAuthResult to a String.

  • Serialize the object to an OAuthToken. The function returns nil is an error is present.

    Declaration

    Swift

    @objc
    public func serializeToToken() -> OAuthToken?

    Return Value

    Serialized OAuthResult to an OAuthToken.