.NET Example of Retrieving a SAML Token

The example is based on the code in the ExternalPscSsoWorkflow.cs sample file.

This example uses the steps that are described in the Retrieve a SAML Token procedure.

Note: For a complete and up-to-date version of the sample code, see the vSphere Automation SDK .NET samples at GitHub.
...
 
Console.WriteLine("\nStep 2: Discover the Single Sign-On service "
                  + "URL from lookup service.");
String ssoUrl = lookupServiceHelper.FindSsoUrl();

Console.WriteLine("\nStep 3: Connect to the Single Sign-On URL and"
                  + " retrieve the SAML bearer token.");
SamlToken samlBearerToken = SsoHelper.GetSamlBearerToken(ssoUrl,
    UserName, Password);