APIKeyAuthenticationStep
open class APIKeyAuthenticationStep : OnboardingStep
Onboarding step implementation of APIKey Authentication Used in the onboarding/restoring flow, this step is responsible to configure the app’s URLSession to be able to communicate with apikey authentication protected resources. Creates and registers the APIKeyAuthenticationObserver to the SAPURLSession, then sends a validation request.
-
Tells the authentication step whether offline restore should be supported. If the property is
true
, the authentication step gracefully handles network conditions when restoring while offline. By default this property istrue
.Declaration
Swift
public var isAllowingOfflineRestore: Bool
-
Designated initializer
Declaration
Swift
public init()
-
Undocumented
Declaration
Swift
public init(config: APIKeyAuthenticationConfig?)
-
Onboards to the given URL
Declaration
Swift
open func onboard(sapURLSession: SAPURLSession, validationURL: URL, apikeyAuthConfig: APIKeyAuthenticationConfig, completionHandler: @escaping (Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handle the connection to the authenticationURLvalidationURL
resource URL that is used for auth validation
apikeyAuthConfig
APIKeyAuthenticationConfig
to be used for apikey authenticationcompletionHandler
called when the process finished. Error filled on failure.
-
Restore the previous state of onboarding
Declaration
Swift
open func restore(sapURLSession: SAPURLSession, validationURL: URL, apikeyAuthConfig: APIKeyAuthenticationConfig, completionHandler: @escaping (Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handle the connection to the authenticationURLvalidationURL
resource URL that is used for auth validation
apikeyAuthConfig
APIKeyAuthenticationConfig
to be used for apikey authenticationcompletionHandler
called when the process finished. Error filled on failure.
-
Resets the modifications of step
Declaration
Swift
open func reset(sapURLSession: SAPURLSession, completionHandler: @escaping () -> Void)
Parameters
sapURLSession
SAPURLSession
on which the apikey authentication observer has to be removedcompletionHandler
called when the process finished.
-
This method creates the
APIKeyAuthenticationObserver
instance used on theSAPURLSession
in theOnboardingContext
. The step user may override this method to supply a customAPIKeyAuthenticationObserver
.Declaration
Swift
open func createAPIKeyAuthenticationObserver(apiKeyCredentialDiscovery: APIKeyCredentialDiscovery, isAPIKeyAccessOnlySecConfig: Bool) -> APIKeyAuthenticationObserver
Parameters
apiKeyCredentialDiscovery
The
FioriBasicCredentialsViewControllerPresenter
used by the observer.isAPIKeyAccessOnlySecConfig
The flag that should be set to true for API Key Access Only security configuration, else false.
Return Value
An instance of the
BasicAuthenticationObserver
.
-
Onboarding function with
OnboardingContext
supportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
Restore function with
OnboardingContext
supportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
Background function with
OnboardingContext
supportDeclaration
Swift
open func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
resetPasscode function with
OnboardingContext
supportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
Reset function with
OnboardingContext
supportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)
Parameters
context
completionHandler
called when the process finished.