SAPcpmsCSRFTokenConfigurationStep

open class SAPcpmsCSRFTokenConfigurationStep : SimpleTaskStep

An OnboardingStep capable of registering the CSRFTokenObserver in the onboard / restore flow. Use this step if you enabled CSRF Protection for your app in SAP Mobile Services.

  • Instantiates an OnboardingStep capable of registering the CSRFTokenObserver, using SAP Mobile Services as rootURL, in the onboard / restore flow.

    It will remove any CSRFTokenObserver instances during the reset flow.

    Declaration

    Swift

    public init(infoKey: OnboardingInfoKey = .sapcpmsSettingsParameters)

    Parameters

    infoKey

    the necessary SAPcpmsSettingsParameters must be present under this key in the OnboardingContext’s info object

  • This method creates the CSRFTokenObserver instance used on the SAPURLSession in the OnboardingContext. You may override this method if your backend endponts are also CSRF protected. Then you must use a custom CSRFTokenURLProviding to provide the correct CSRF URL for different request URL’s.

    Note: The default implementation will only handle CSRF protection for services offered by SAP Mobile Services, e.g. client log upload

    Declaration

    Swift

    open func createCSRFTokenObserver(settingsParameters: SAPcpmsSettingsParameters) -> CSRFTokenObserver

    Parameters

    settingsParameters

    to identify to which backendURL the logout request shall be send

    Return Value

    An instance of the CSRFTokenObserver