Authenticate with
Credentials and Create a Session
To establish a
session with the
vSphere
Automation
API Endpoint in the
, you create a connection to the endpoint and
authenticate with
credentials to receive a session ID.
To perform this task, you must
have the following items in place:
- The DNS name or IP address of the
- AvCenter Single Sign-Ondomain account that has the requisite permissions for the operation that you intend to invoke
- Create a connection context by specifying thevSphere AutomationAPI Endpoint URL and the message protocol to be used for the connection.
- Create the request options or stub configuration and set the specific security context to be used.The security context contains the user name and password that are used for authenticating to thevSphere AutomationAPI Endpoint.
- Create an interface stub or a REST path that uses the stub configuration.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.
- Add the cookie to your request headers or to a security context for your client stub configuration.
- Remove the basic authentication from your request headers or the security context of your client stub configuration.
Subsequent method calls
authenticate with the session cookie instead of the user name and password.
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.