OTPParameters

public struct OTPParameters

This struct contains the necessary parameters to conduct a OTP authentication using a web view. This is used with the OTPAuthenticator class.

  • The URL to navigate to for authentication in case of an OTP challange. This URL will be set as the initial URL in a web view.

    Declaration

    Swift

    public let authorizationEndpointURL: URL
  • The URL, which when encountered indicates the OTP authentication flow’s end. During the OTP authentication process there could be multiple redirections to different URLs.

    Declaration

    Swift

    public let finishEndpointURL: URL
  • Determines the header name which indicates a SAML challenge.

    Declaration

    Swift

    public let challengeHeaderName: String
  • Determines the header name which indicates a SAML challenge.

    Declaration

    Swift

    public let challengeHeaderValue: String
  • Instantiates the OTPParameters

    Declaration

    Swift

    public init(authorizationEndpointURL: URL, finishEndpointURL: URL, challengeHeaderName: String = OTPChallengeHeaderName, challengeHeaderValue: String = OTPChallengeHeaderValue)

    Parameters

    authorizationEndpointURL

    The URL to navigate to for authentication in case of an OTP challange. This URL will be set as the initial URL in a web view.

    finishEndpointURL

    The URL, which when encountered indicates the OTP authentication flow’s end. During the OTP authentication process there could be multiple redirections to different URLs.

  • Instantiates the OTPParameters from the SAP Cloud Platform configuration object. The configuration object is expected in the following format:

    let configuration: [String: String] = [
        "authorizationEndpointURL": "<#authentication endpoint URL string#>",
        "finishEndpointURL": "<#finish endpoint URL string#>"
    ]
    

    The URL strings are converted to URL using the URL object’s string initializer. If the initializer returns nil, an error is raised.

    Throws

    ConfigurationError if the configuration is not matching.

    Declaration

    Swift

    public init(discoveryServiceConfig config: Any) throws

    Parameters

    config

    The SAP Cloud Platform configuration object