Authenticator
public protocol Authenticator
Interface for authentication actions like login and logout.
-
Performs the login operation.
Declaration
Swift
func authenticate(presentingViewController: UIViewController, onCompleted: @escaping (_ user: User?, _ error: Error?) -> Void)Parameters
presentingViewControllerthe view controller
onCompletedcallback function that is invoked when the login is completed
userthe user returned in the
onCompletedcallback function. Will be nil if authentication failederrorthe error returned in the
onCompletedcallback function. Will be nil if authentication was successful -
Resumes the login operation.
Declaration
Swift
func resumeAuth(url: URL) -> BoolParameters
urlthe redirect url used to redirect back to the app after a login attempt via the device browser
Return Value
true if the login action can be resumed, false otherwise
-
Performs the logout operation.
Declaration
Swift
func logout(currentUser: User, onCompleted: @escaping (_ error: Error?) -> Void)Parameters
currentUserthe user to be logged out
onCompletedcallback function that is invoked when the logout is completed
errorthe error returned in the
onCompletedcallback function. Will be nil if login was successful
Authenticator Protocol Reference