AuthenticationMethod
public protocol AuthenticationMethod : AnyObject, CustomDebugStringConvertible
A type representing an authentication method.
The type conforming to this protocol are designed to be called with special provisions by an AuthenticationService instance.
To prevent them from being called directly, they all take a WebcomMarkers.Restricted parameter, which could not be instantiated by external code.
-
The authentication provider corresponding to this method.
Declaration
Swift
var provider: AuthenticationProvider { get } -
Initializes an authentication process.
This method is designed to be called by the
AuthenticationService.initializeAuthentication(with:context:)method of anAuthenticationServiceinstance.Declaration
Swift
func initializeAuthentication(_ restricted: WebcomMarkers.Restricted, for service: AuthenticationService) -> WebcomResult<Void>Parameters
restrictedA type that only the SDK can instantiate to prevent this method from being called directly.
serviceThe service for which this authenticated method is used.
Return Value
A value indicating whether the authentication initialization succeeds.
-
Runs an authentication process.
This method is designed to be called by the
AuthenticationService.continueAuthentication(queue:then:)method of anAuthenticationServiceinstance.Declaration
Swift
func authenticate(_ restricted: WebcomMarkers.Restricted, then completionCallback: @escaping WebcomResult<AuthenticationDetails>.Callback)Parameters
restrictedA type that only the SDK can instantiate to prevent this method from being called directly.
completionCallbackThe closure to call upon completion. In case of success, it is called with the authenticated user details. In case of failure, it is called with a
WebcomErrorvalue indicating the reason of the failure. -
terminateAuthentication(_:Default implementation) Terminates normally an authentication process.
This method is designed to be called by the
AuthenticationService.continueAuthentication(queue:then:)method of anAuthenticationServiceinstance.By default, this method does nothing.
Default Implementation
Declaration
Swift
func terminateAuthentication(_ restricted: WebcomMarkers.Restricted)Parameters
restrictedA type that only the SDK can instantiate to prevent this method from being called directly.
-
cancelAuthentication(_:Default implementation) Cancels an authentication process.
This method is designed to be called by the
AuthenticationService.cancelAuthentication()method of anAuthenticationServiceinstance.By default, this method just calls
terminateAuthentication(_:).Default Implementation
Declaration
Swift
func cancelAuthentication(_ restricted: WebcomMarkers.Restricted)Parameters
restrictedA type that only the SDK can instantiate to prevent this method from being called directly.