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
}

  • 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

    sapURLSession

    SAPURLSession that handle the connection to the authenticationURL

    authenticationURL

    resource URL that needs basic authentication

    credentialStore

    UserIdentity will save in the given store

    presentationDelegate

    delegate to present the BasicCredentialViewController

    userIdentityConfigurationParameters

    configuration parameters for the discovery service

    oAuth2AuthenticationParameters

    authentication parameters for the OAuth2 authentication

    completionHandler

    called when the process finished. Error filled on failure.

  • 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

    sapURLSession

    SAPURLSession that handle the connection to the authenticationURL

    authenticationURL

    resource URL that needs basic authentication

    credentialStore

    UserIdentity will save in the given store

    presentationDelegate

    delegate to present the BasicCredentialViewController

    userIdentityConfigurationParameters

    configuration parameters for the discovery service

    oAuth2AuthenticationParameters

    authentication parameters for the OAuth2 authentication

    completionHandler

    called when the process finished. Error filled on failure.

  • Resets the modifications of OnboardingStep

    Declaration

    Swift

    open func reset(sapURLSession: SAPURLSession, completionHandler: @escaping () -> Void)

    Parameters

    completionHandler

    called when the process finished

  • Create a store to keep the credential

    Declaration

    Swift

    open func createUserIdentityStore(using credentialsStore: CodableStoring) -> UserIdentityStoring

    Parameters

    credentialsStore

    The store to use when handling UserIdentitys.

    Return Value

    a UserIdentityStoring to store and retrieve the UserIdentitys.