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 anAuthenticationService
instance.Declaration
Swift
func initializeAuthentication(_ restricted: WebcomMarkers.Restricted, for service: AuthenticationService) -> WebcomResult<Void>
Parameters
restricted
A type that only the SDK can instantiate to prevent this method from being called directly.
service
The 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 anAuthenticationService
instance.Declaration
Swift
func authenticate(_ restricted: WebcomMarkers.Restricted, then completionCallback: @escaping WebcomResult<AuthenticationDetails>.Callback)
Parameters
restricted
A type that only the SDK can instantiate to prevent this method from being called directly.
completionCallback
The 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
WebcomError
value 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 anAuthenticationService
instance.By default, this method does nothing.
Default Implementation
Declaration
Swift
func terminateAuthentication(_ restricted: WebcomMarkers.Restricted)
Parameters
restricted
A 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 anAuthenticationService
instance.By default, this method just calls
terminateAuthentication(_:)
.Default Implementation
Declaration
Swift
func cancelAuthentication(_ restricted: WebcomMarkers.Restricted)
Parameters
restricted
A type that only the SDK can instantiate to prevent this method from being called directly.