ParseAuthentication

public protocol ParseAuthentication : Decodable, Encodable

Objects that conform to the ParseAuthentication protocol provide convenience implementations for using 3rd party authentication methods. The authentication methods supported by the Parse Server can be found here.

  • The type of authentication.

    Declaration

    Swift

    static var __type: String { get }
  • Returns true if the current user is linked to the respective authentication type.

    Declaration

    Swift

    var isLinked: Bool { get }
  • Login a ParseUser asynchronously using the respective authentication type.

    Declaration

    Swift

    func login(authData: [String: String],
               options: API.Options,
               callbackQueue: DispatchQueue,
               completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    authData

    The authData for the respective authentication type.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Link the current ParseUser asynchronously using the respective authentication type.

    Declaration

    Swift

    func link(authData: [String: String],
              options: API.Options,
              callbackQueue: DispatchQueue,
              completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    authData

    The authData for the respective authentication type.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • isLinked(with:) Default implementation

    Whether the ParseUser is logged in with the respective authentication type.

    Default Implementation

    Declaration

    Swift

    func isLinked(with user: AuthenticatedUser) -> Bool

    Parameters

    user

    The ParseUser to check authentication type. The user must be logged in on this device.

    Return Value

    true if the ParseUser is logged in via the repective authentication type. false if the user is not.

  • Unlink the ParseUser asynchronously from the respective authentication type.

    Default Implementation

    Declaration

    Swift

    func unlink(_ user: AuthenticatedUser,
                options: API.Options,
                callbackQueue: DispatchQueue,
                completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    user

    The ParseUser to unlink. The user must be logged in on this device.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute. It should have the following argument signature: (Result<Self, ParseError>).

  • Unlink the current ParseUser asynchronously from the respective authentication type.

    Default Implementation

    Declaration

    Swift

    func unlink(options: API.Options,
                callbackQueue: DispatchQueue,
                completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute. It should have the following argument signature: (Result<AuthenticatedUser, ParseError>).

  • strip() Default implementation

    Strips the current user of a respective authentication type.

    Default Implementation

    Declaration

    Swift

    func strip()
  • strip(_:) Default implementation

    Strips the ParseUserof a respective authentication type.

    Default Implementation

    Declaration

    Swift

    func strip(_ user: AuthenticatedUser) -> AuthenticatedUser

    Parameters

    user

    The ParseUser to strip. The user must be logged in on this device.

    Return Value

    The user whose autentication type was stripped. This modified user has not been saved.

  • Login a ParseUser asynchronously using the respective authentication type.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func loginPublisher(authData: [String: String],
                        options: API.Options) -> Future<AuthenticatedUser, ParseError>

    Parameters

    authData

    The authData for the respective authentication type.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Link the current ParseUser asynchronously using the respective authentication type.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func linkPublisher(authData: [String: String],
                       options: API.Options) -> Future<AuthenticatedUser, ParseError>

    Parameters

    authData

    The authData for the respective authentication type.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • unlinkPublisher(_:options:) Default implementation

    Unlink the ParseUser asynchronously from the respective authentication type.

    Default Implementation

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func unlinkPublisher(_ user: AuthenticatedUser,
                         options: API.Options) -> Future<AuthenticatedUser, ParseError>

    Parameters

    user

    The ParseUser to unlink. The user must be logged in on this device.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute. It should have the following argument signature: (Result<Self, ParseError>).

  • unlinkPublisher(options:) Default implementation

    Unlink the current ParseUser asynchronously from the respective authentication type.

    Default Implementation

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func unlinkPublisher(options: API.Options) -> Future<AuthenticatedUser, ParseError>

    Parameters

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute. It should have the following argument signature: (Result<Self, ParseError>).

Convenience Implementations

  • __type Extension method

    Declaration

    Swift

    var __type: String { get }