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
sapURLSessionSAPURLSessionthat handle the connection to the authenticationURLvalidationURLresource URL that is used for auth validation
apikeyAuthConfigAPIKeyAuthenticationConfigto be used for apikey authenticationcompletionHandlercalled 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
sapURLSessionSAPURLSessionthat handle the connection to the authenticationURLvalidationURLresource URL that is used for auth validation
apikeyAuthConfigAPIKeyAuthenticationConfigto be used for apikey authenticationcompletionHandlercalled when the process finished. Error filled on failure.
-
Resets the modifications of step
Declaration
Swift
open func reset(sapURLSession: SAPURLSession, completionHandler: @escaping () -> Void)Parameters
sapURLSessionSAPURLSessionon which the apikey authentication observer has to be removedcompletionHandlercalled when the process finished.
-
This method creates the
APIKeyAuthenticationObserverinstance used on theSAPURLSessionin theOnboardingContext. The step user may override this method to supply a customAPIKeyAuthenticationObserver.Declaration
Swift
open func createAPIKeyAuthenticationObserver(apiKeyCredentialDiscovery: APIKeyCredentialDiscovery, isAPIKeyAccessOnlySecConfig: Bool) -> APIKeyAuthenticationObserverParameters
apiKeyCredentialDiscoveryThe
FioriBasicCredentialsViewControllerPresenterused by the observer.isAPIKeyAccessOnlySecConfigThe 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
OnboardingContextsupportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Restore function with
OnboardingContextsupportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Background function with
OnboardingContextsupportDeclaration
Swift
open func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
resetPasscode function with
OnboardingContextsupportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Reset function with
OnboardingContextsupportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)Parameters
contextcompletionHandlercalled when the process finished.