OAuth
public struct OAuth
OAuth namespace.
-
An authenticated user.
See moreDeclaration
Swift
public struct User : Codable, Equatable -
A failed authorization as per RFC 6749.
See moreDeclaration
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
viewAn object handling UI-specific actions related to the authorization flow.
appKeyAn app key.
completionTokenA block called when authorization completes. Called on the main thread.
-
Fetches the first
OAuth.Userfound in the keychain. Do not rely on which, specifically, that user is. If you’re looking for a specific user, usegetUser(withId:).Declaration
Swift
public static func getAnyUser() -> User?Return Value
A
OAuth.User. -
Fetches a
OAuth.Userobject from the keychain using a user id.Declaration
Swift
public static func getUser(withId id: UInt64) -> User?Parameters
idA unique user identifier.
Return Value
A User object, or
nil, if there is no user mapped to the provided user id. -
Stores a
OAuth.Userobject in the keychain against its unique identifier.Declaration
Swift
public static func store(_ user: User)Parameters
userThe user to store in the keychain.
-
Deletes the data associated with a specific user.
Declaration
Swift
public static func deleteUser(withId id: UInt64)Parameters
idThe unique user identifier.
-
Deletes all users from the keychain.
Declaration
Swift
public static func deleteAllUsers()
View on GitHub
OAuth Structure Reference