SAMLAuthenticationParameters

public struct SAMLAuthenticationParameters

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

  • The URL to navigate to for authentication in case of a SAML 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 SAML authentication flow’s end. During the SAML 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 SAMLAuthenticationParameters

    Declaration

    Swift

    public init(authorizationEndpointURL: URL, finishEndpointURL: URL, challengeHeaderName: String = SAMLChallengeHeaderName, challengeHeaderValue: String = SAMLChallengeHeaderValue)

    Parameters

    authorizationEndpointURL

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

    finishEndpointURL

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

  • Instantiates the SAMLAuthenticationParameters from the SAPcpmsSettingsParameters. The constructed parameters have the following structure:

    • authorizationEndpointURL: https://<#backend URL#>/SAMLAuthLauncher
    • finishEndpointURL: https://<#backend URL#>/SAMLAuthLauncher?finishEndpointParam=someUnusedValue
    • challengeHeaderName: com.sap.cloud.security.login
    • challengeHeaderValue: login-request

    Declaration

    Swift

    public init(settingsParameters: SAPcpmsSettingsParameters)

    Parameters

    settingsParameters

    The SAPcpmsSettingsParameters contaning the backend URL.

  • Instantiates the SAMLAuthenticationParameters from the Discovery Service configuration object. Example Discovery Service configuration structure contaning a SAML configuration:

    {
      "auth": [{
          "type": "saml2.web.post",
          "config": {
              "saml2.web.post.authchallengeheader.name": "com.sap.cloud.security.login",
              "saml2.web.post.finish.endpoint.uri": "/SAMLAuthLauncher",
              "saml2.web.post.finish.endpoint.redirectparam": "finishEndpointParam"
          }
      }],
      "host": "<#host URL string#>",
      "port": 443,
      "protocol": "https"
    }
    

    Will use the corresponding auth-type if there are multiple auths.

    The backend URL is constructed using the ‘host’, ‘port’ and ‘protocol’ parameters. The constructed URL must be valid according to RFC 3986: https://www.ietf.org/rfc/rfc3986.txt otherwise an error is thrown.

    Throws

    ConfigurationError if a key is missing or the object has invalid structure

    Declaration

    Swift

    public init(discoveryServiceConfig config: Any) throws

    Parameters

    config

    The Disovery Service configuration object.

  • Instantiates the SAMLAuthenticationParameters from the corresponding sub-configuration of the Discovery Service configuration object. Example SAML sub-configuration structure in a Discovery Service configuration object:

    {
      "saml2.web.post.authchallengeheader.name": "com.sap.cloud.security.login",
      "saml2.web.post.finish.endpoint.uri": "/SAMLAuthLauncher",
      "saml2.web.post.finish.endpoint.redirectparam": "finishEndpointParam"
    }
    

    Throws

    ConfigurationError if a key is missing or the object has invalid structure

    Declaration

    Swift

    public init(backendURL: URL, config: Any) throws

    Parameters

    backendURL

    The base URL used to construct the SAML authentication URLs.

    config

    The SAML sub-configuration object of the Disovery Service configuration object.