vCenter Server Single
Sign-On Session
After you obtain a SAML token from the
vCenter Single Sign-On Server, you can use the vSphere API method
LoginByToken
to establish a single
sign-on session with a
instance.
See
vCenter Single Sign-On Client Example for an example of obtaining
a vCenter Single Sign-On token.
At the beginning of a vCenter Single Sign-On
session, your client is responsible for the following tasks:
- Maintain the vCenter session cookie. The vSphere architecture uses an HTTP cookie to support a persistent connection between a vSphere client and a instance. During the initial connection, the Server produces a session cookie. Operations during the login sequence will reset the request context so your client must save this cookie and re-introduce it at the appropriate times.
- Insert the vCenter Single Sign-On token and a timestamp into the SOAP header of theLoginByTokenmessage.
The example program uses these general steps.
- Call theRetrieveServiceContentmethod to establish an HTTP connection with the instance and save the HTTP session cookie. The client uses an HTTP header handler method to extract the cookie from the response.
- Call theLoginByTokenmethod to authenticate the vCenter session. To send the token to the instance, the client uses a handler to embed the token and a time stamp in the SOAP header for the message. To identify the session started with theRetrieveServiceContentmethod, the client uses a handler to embed the session cookie in the HTTP header.
- Restore the session cookie.