UserManager
public class UserManager
Stores user data, populated during the authentication process.
-
Shared singleton instance
Declaration
Swift
public private(set) static var sharedInstance = UserManager() -
Replaces existing sharedInstance with new UserManager instance
Declaration
Swift
public static func setSharedInstance(_ manager: UserManager) -
Initializes a new
UserManagerinstance with the provided dictionary of User data. Will return nil if the dictionary does not contain the minimum key/value pairs needed for aUserobjectDeclaration
Swift
public init?(userData: [String : Any])
-
Returns user dictionary obtained during authentication
Declaration
Swift
public func getUser() -> [String : Any] -
Returns user information for provided key
Declaration
Swift
public func getData<T>(_ key: String) -> T? -
Returns user name as obtained during authentication
Declaration
Swift
public func userName() -> String?
-
Stores the provided offline password in the keychain.
Only valid when user is authenticated online, and has not previously set up an offline password.
This password will not be used if using an
AuthenticationManagerConfigurationwithallowsOnlineCredentialsForOfflineAccessorisTouchIDEnabledset to true.Throws an error if storing the password fails.
Declaration
Swift
public func setupOfflinePassword(password: String) throwsParameters
passwordthe password to store.
-
Changes the stored offline password.
Only valid when user is authenticated online, and user has previously set up an offline password.
This password will not be used if using an
AuthenticationManagerConfigurationwithallowsOnlineCredentialsForOfflineAccessorisTouchIDEnabledset to true.Throws an error if changing the password fails.
Declaration
Swift
public func changeOfflinePassword(from: String, to: String) throwsParameters
fromthe user’s previous offline password.
tothe new password to store.
-
Removes any existing stored offline password, or online Touch ID refresh tokens.
Throws an error if the deletion fails.
Declaration
Swift
public func resetCredentials() throws
View on GitHub
UserManager Class Reference