OAuth

public struct OAuth

OAuth namespace.

  • The result of an authorization attempt.

    See more

    Declaration

    Swift

    public enum Result
    extension OAuth.Result: CustomStringConvertible
  • An authenticated user.

    See more

    Declaration

    Swift

    public struct User : Codable, Equatable
  • A failed authorization as per RFC 6749.

    See more

    Declaration

    Swift

    public enum Error : String, Swift.Error
  • Undocumented

    Declaration

    Swift

    public static func performAuthorizationFlow(with anchor: ASPresentationAnchor, appKey: String, completionBlock: @escaping (Result) -> Void)
  • Attempts to authorize via OAuth.

    Declaration

    Swift

    public static func performAuthorizationFlow(with view: OAuthAuthorizationFlowView, appKey: String, completionBlock: @escaping (Result) -> Void)

    Parameters

    view

    An object handling UI-specific actions related to the authorization flow.

    appKey

    An app key.

    completionToken

    A block called when authorization completes. Called on the main thread.

  • Fetches the first OAuth.User found in the keychain. Do not rely on which, specifically, that user is. If you’re looking for a specific user, use getUser(withId:).

    Declaration

    Swift

    public static func getAnyUser() -> User?

    Return Value

    A OAuth.User.

  • Fetches a OAuth.User object from the keychain using a user id.

    Declaration

    Swift

    public static func getUser(withId id: UInt64) -> User?

    Parameters

    id

    A unique user identifier.

    Return Value

    A User object, or nil, if there is no user mapped to the provided user id.

  • Stores a OAuth.User object in the keychain against its unique identifier.

    Declaration

    Swift

    public static func store(_ user: User)

    Parameters

    user

    The user to store in the keychain.

  • Deletes the data associated with a specific user.

    Declaration

    Swift

    public static func deleteUser(withId id: UInt64)

    Parameters

    id

    The unique user identifier.

  • Deletes all users from the keychain.

    Declaration

    Swift

    public static func deleteAllUsers()