You can use your vCenter Single Sign-On credentials with basic authentication to establish a session with a vCenter Server system.

The single-factor basic authentication is the default method to authenticate to vCenter Server. You connect to the vSphere Automation SDKs with your vCenter Single Sign-On user name and password. The vSphere Automation endpoint checks whether the user credentials are present in vmdir, a vCenter Single Sign-On component. On success, the system returns a session identifier that you can use for subsequent API calls.

Prerequisites

  • Retrieve the vSphere Automation endpoint URL from the Lookup Service.

  • Verify that you have valid user credentials for the vCenter Single Sign-On identity store.

Procedure

  1. Create a connection stub by specifying the vSphere Automation endpoint URL and the message protocol to be used for the connection.
  2. Create a stub configuration instance and set the specific security context to be used.

    The security context object uses the user name and password that are used for authenticating to the vCenter Single Sign-On service.

  3. Create a Session stub that uses the stub configuration instance.
  4. Call the create operation on the Session stub to create an authenticated session to the vSphere Automation endpoint.

    The operation returns a session identifier.

  5. Create a security context instance and add the session ID to it.
  6. Update the stub configuration instance with the session security context.
    Note:

    VMware encourages you to refrain from using basic authentication and adopt token-based authentication, as it is more secure and provides more flexibility.

What to do next

You can use the authenticated session to access vSphere Automation services. For more information about creating stubs to the vSphere Automation services, see Accessing vSphere Automation Services.