SAPcpmsUserIdentityDiscoveryAuthenticationStep
open class SAPcpmsUserIdentityDiscoveryAuthenticationStep : OnboardingStep
Onboarding step implementation of SAPcpmsUserIdentityDiscovery Authentication Used in the onboarding/restoring flow, this step is responsible to configure the app’s URLSession to be able to communicate with SAPcpmsUserIdentityDiscovery authentication protected resources. Creates and registers the UserIdentityObserver to the SAPURLSession, then sends a validation request which will trigger an authentication flow.
Customization
During the onboarding flow, if there is a splash screen which shows a text, that text can be changed/localized. The presented webView will also have localizable components, but the localization of downloaded data depends on the server and is not customizable from the created client application.
//The localized SAPcpmsUserIdentityDiscoveryAuthenticationStep can be created like the following code snippet
func customSAPcpmsUserIdentityDiscoveryAuthenticationStep() -> OnboardingStep {
let step = SAPcpmsUserIdentityDiscoveryAuthenticationStep()
let userIdentityDiscoveryAuthenticationBundle = Bundle(for: SAPcpmsUserIdentityDiscoveryAuthenticationStep.self)
step.infoScreenText = NSLocalizedString("UserIdentityDiscoveryInfoScreenTextKey", tableName: "ExampleTableName", bundle: userIdentityDiscoveryAuthenticationBundle, value: "Example Info Screen Text", comment: "")
return step
}
-
The
OnboardingInfoKeyassociated with an instance ofSAPcpmsUserIdentityDiscoveryConfigurationParametersin theOnboardingContextinfo.Declaration
Swift
public let userIdentityConfigurationParametersInfoKey: OnboardingInfoKey -
The
OnboardingInfoKeyassociated with an instance ofSAPcpmsUserIdentityDiscoveryOAuth2AuthenticationParametersin theOnboardingContextinfo.Declaration
Swift
public let oauth2AuthenticationParametersInfoKey: OnboardingInfoKey -
The presentationDelegate to present the WebViewController
Declaration
Swift
public var presenter: FlowPresentationDelegateClient! -
Property to set the title of info screen
Declaration
Swift
public var infoScreenText: String -
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 -
init(presenter:userIdentityConfigurationParametersInfoKey:oauth2ClientCredentialsAuthenticationParametersInfoKey:)Instantiates the SAPcpmsUserIdentityDiscovery onboarding step.
Declaration
Swift
public init(presenter webViewPresenter: WKWebViewPresenting & FlowPresentationDelegateClient = FioriWKWebViewPresenter(), userIdentityConfigurationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryConfigurationParameters, oauth2ClientCredentialsAuthenticationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryOAuth2AuthenticationParameters)Parameters
webViewPresenterThe web view presenter which will supply an
WKWebViewinstance.userIdentityConfigurationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryConfigurationParametersinstance in theOnboardingContext.oauth2ClientCredentialsAuthenticationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryOAuth2AuthenticationParametersinstance in theOnboardingContext. -
init(presenter:userIdentityConfigurationParametersInfoKey:oauth2ClientCredentialsAuthenticationParametersInfoKey:)Instantiates the SAPcpmsUserIdentityDiscovery onboarding step.
Declaration
Swift
public init(presenter webViewPresenter: SFSafariViewControllerPresenting & FlowPresentationDelegateClient, userIdentityConfigurationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryConfigurationParameters, oauth2ClientCredentialsAuthenticationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryOAuth2AuthenticationParameters)Parameters
webViewPresenterThe web view presenter which will supply an
SFSafariViewControllerinstance.userIdentityConfigurationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryConfigurationParametersinstance in theOnboardingContext.oauth2ClientCredentialsAuthenticationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryOAuth2AuthenticationParametersinstance in theOnboardingContext. -
init(presenter:userIdentityConfigurationParametersInfoKey:oauth2ClientCredentialsAuthenticationParametersInfoKey:)Instantiates the SAPcpmsUserIdentityDiscovery onboarding step.
Declaration
Swift
@available(iOS 12.0, *) public init(presenter webViewPresenter: ASWebAuthenticationSessionPresenting & FlowPresentationDelegateClient, userIdentityConfigurationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryConfigurationParameters, oauth2ClientCredentialsAuthenticationParametersInfoKey: OnboardingInfoKey = .sapcpmsUserIdentityDiscoveryOAuth2AuthenticationParameters)Parameters
webViewPresenterThe web view presenter which will supply an
ASWebAuthenticationSessioninstance.userIdentityConfigurationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryConfigurationParametersinstance in theOnboardingContext.oauth2ClientCredentialsAuthenticationParametersInfoKeyThe
OnboardingInfoKeywhich marks aSAPcpmsUserIdentityDiscoveryOAuth2AuthenticationParametersinstance in theOnboardingContext.
-
onboard(sapURLSession:authenticationURL:credentialStore:presentationDelegate:userIdentityConfigurationParameters:oauth2AuthenticationParameters:completionHandler:)Onboards to the given URL
Declaration
Swift
open func onboard(sapURLSession: SAPURLSession, authenticationURL: URL, credentialStore: CodableStoring, presentationDelegate: FlowPresentationDelegate, userIdentityConfigurationParameters: SAPcpmsUserIdentityConfigurationParameters, oauth2AuthenticationParameters: OAuth2AuthenticationParameters, completionHandler: @escaping (Error?) -> Void)Parameters
sapURLSessionSAPURLSessionthat handle the connection to the authenticationURLauthenticationURLresource URL that needs basic authentication
credentialStoreUserIdentitywill save in the given storepresentationDelegatedelegate to present the
BasicCredentialViewControlleruserIdentityConfigurationParametersconfiguration parameters for the discovery service
oAuth2AuthenticationParametersauthentication parameters for the OAuth2 authentication
completionHandlercalled when the process finished. Error filled on failure.
-
restore(sapURLSession:authenticationURL:credentialStore:presentationDelegate:userIdentityConfigurationParameters:oauth2AuthenticationParameters:completionHandler:)Restore the previous state of onboarding
Declaration
Swift
open func restore(sapURLSession: SAPURLSession, authenticationURL: URL, credentialStore: CodableStoring, presentationDelegate: FlowPresentationDelegate, userIdentityConfigurationParameters: SAPcpmsUserIdentityConfigurationParameters, oauth2AuthenticationParameters: OAuth2AuthenticationParameters, completionHandler: @escaping (Error?) -> Void)Parameters
sapURLSessionSAPURLSessionthat handle the connection to the authenticationURLauthenticationURLresource URL that needs basic authentication
credentialStoreUserIdentitywill save in the given storepresentationDelegatedelegate to present the
BasicCredentialViewControlleruserIdentityConfigurationParametersconfiguration parameters for the discovery service
oAuth2AuthenticationParametersauthentication parameters for the OAuth2 authentication
completionHandlercalled when the process finished. Error filled on failure.
-
Resets the modifications of OnboardingStep
Declaration
Swift
open func reset(sapURLSession: SAPURLSession, completionHandler: @escaping () -> Void)Parameters
completionHandlercalled when the process finished
-
Create a store to keep the credential
Declaration
Swift
open func createUserIdentityStore(using credentialsStore: CodableStoring) -> UserIdentityStoringParameters
credentialsStoreThe store to use when handling
UserIdentitys.Return Value
a
UserIdentityStoringto store and retrieve theUserIdentitys.
-
Onboarding function with
OnboardingContextsupportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Filled with OnboardingResult
-
Restore function with
OnboardingContextsupportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Filled with OnboardingResult
-
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
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished.