Create a
vSphere
Automation Session with a SAML Token
vSphere
Automation
Session with a SAML TokenTo establish a
vSphere
Automation
session, you create a connection to the vSphere
Automation
API endpoint and then you authenticate with a SAML token to
create a session for the connection. - Retrieve thevSphere Automationendpoint URL from the Lookup Service.
- Obtain a SAML token from the vCenter Single Sign-On service.
- Create a connection by specifying thevSphere AutomationAPI endpoint URL and the message protocol to be used for the connection.To transmit your requests securely, usehttpsfor thevSphere AutomationAPI endpoint URL.
- Create the request options or stub configuration and set the security context to be used.The security context object contains the SAML token retrieved from thevCenter Single Sign-Onservice. Optionally, the security context might contain the private key of the client application.
- Create an interface stub or a REST path that uses the stub configuration instance.The interface stub corresponds to the interface containing the method to be invoked.
- Invoke the sessioncreatemethod.The service creates an authenticated session and returns a session identification cookie to the client.
- Create a security context instance and add the session ID to it.
- Update the stub configuration instance with the session security context.
Use the updated stub
configuration with the session ID to create a stub for the interface that you
want to use. Method calls on the new stub use the session ID to authenticate.