Java Example of Retrieving a SAML Token
The example is based on the code in the ExternalPscSsoWorkflow.java sample.
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 Java samples at GitHub.
... LookupServiceHelper lookupServiceHelper = new LookupServiceHelper( this.lookupServiceUrl); System.out.println("\nStep 2: Discover the Single Sign-On service URL" + " from lookup service."); String ssoUrl = lookupServiceHelper.findSsoUrl(); System.out.println("\nStep 3: Connect to the Single Sign-On URL and " + "retrieve the SAML bearer token."); SamlToken samlBearerToken = SsoHelper.getSamlBearerToken(ssoUrl, username, password);