Developer

SAML Authentication

Develop SAML authentication for Windows apps.

The Windows SAP Mobile Platform SDK provides support for submitting requests to access SAML-protected resources. SAML support is integrated with the SAP.Net.Http.HttpClient library. The following process flow illustrates the steps required to submit request to access SAML-protected resources using the SAP.Net.Http.HttpClient library.

  1. ShouldHandleSamlRequests property
    • If the backend server supports SAML authentication, then setting this property to true allows the networking library to handle the SAML requests.
    • If the backend server does not support SAML authentication, then setting this property has no effect.
  2. SAML authenticaiton URL (optional) - If the backend server supports SAML authentication, the server can respond using an HTTP-POST binding.

    As an optional measure, the developer can set the SAML authentication URL manually. This tells the networking library that if there is a SAML request, then the SAML authentication needs to be done in the specified URL. Some SAP servers require this.

  3. Set string to mark the end of the SAML authentication flow (optional) - You can set a string that should appear in the URL to mark the end of the SAML authentication flow. Some SAP servers require this.

Example

// This call tells the networking library to handle SAML requests, if the backend server supports it.
client.ShouldHandleSamlRequests = true;
 
// This property is optional, but some servers require it. This tells the networking library that 
// if there is a SAML request then the SAML authentication should be done on this URL.
client.SamlFinishEndpoint = new UriBuilder("http", ServerHost, ServerPort, "/SAMLAuthLauncher").Uri;
 
// This property is optional. Normally the SAML authentication flow ends when we return to the original URL
// that caused the SAML authentication to take place. However, this is not always the case. 
// The developer can set a string that should appear in a URL, which marks the end of the SAML flow. 
client.SamlFinishEndpointParameter = "finishEndpointParam";