vCenter Single Sign-On SDK Examples

The vCenter Single Sign-On SDK contains both C# and Java examples that show how to acquire, validate, and renew tokens. This manual describes examples that show how to obtain a holder-of-key token from a vCenter Single Sign-On server and how to use that token to login to a vCenter server.

vCenter Single Sign-On Examples - C#

Each example is implemented as a Visual Studio project that is contained in its own subdirectory in the samples directory. Each project subdirectory contains an example implementation and the corresponding Visual Studio project files. The following table lists the example projects.
VMware SSO Client SDK Sample Files – C#
Location
Visual Studio Project
Description
SDK/ssoclient/dotnet/cs/samples/
AcquireBearerTokenByUserCredentialSample
Demonstrates how to use username and password credentials to obtain a bearer token.
AcquireHoKTokenByHoKTokenSample
Demonstrates how to use an existing holder-of-key token to obtain a new holder-of-key token.
AcquireHoKTokenBySolutionCertificateSample
Demonstrates how to use a solution certificate to obtain a holder-of-key token.
AcquireHoKTokenByUserCredentialSample
Demonstrates how to use username and password credentials to obtain a holder-of-key token.

vCenter Single Sign-On Examples - Java

This manual describes two of the Java examples provided by the VMware SSO Client SDK:
The following table lists the sample files in the SDK:
VMware SSO Client SDK Sample Files – Java
Location
Examples
Description
SDK/ssoclient/java/JAXWS/samples/com/vmware/sso/client/samples/
AcquireBearerTokenByUserCredentialSample.java
Demonstrates how to use username and password credentials to obtain a bearer token.
AcquireHoKTokenByHoKTokenSample.java
Demonstrates how to exchange one holder-of-key token for another.
AcquireHoKTokenBySolutionCertificateSample.java
Demonstrates how a solution uses its private key and certificate to acquire a holder-of-key token.
AcquireHoKTokenByUserCredentialSample.java
Demonstrates how to use username, password, and certificate credentials to obtain a holder-of-key token. See vCenter Single Sign-On Client Example (JAX-WS).
RenewTokenSample.java
Demonstrates how to renew a holder-of-key token.
ValidateTokenSample.java
Demonstrates how to validate a token.
SDK/ssoclient/java/JAXWS/samples/com/vmware/sso/client/soaphandlers/
HeaderHandlerResolver.java
Provides methods to manage the set of header handlers.
SamlTokenExtractionHandler.java
Extracts a SAML token from the vCenter Single Sign-On server response.
SamlTokenHandler.java
Adds a SAML token to a SOAP security header.
SSOHeaderhandler.java
Base class for header handler classes.
TimeStampHandler.java
Adds a timestamp element to a SOAP security header.
UserCredentialHandler.java
Adds a username token to a SOAP security header.
WsSecuritySignatureAssertionHandler.java
Uses SAML token assertion ID, private key, and certificate to sign a SOAP message. For use when using an existing token to acquire a new token.
WsSecurityUserCertificateSignatureHandler.java
Uses a private key and certificate to sign a SOAP message.
SDK/ssoclient/java/JAXWS/samples/com/vmware/vsphere/samples/
LoginByTokenSample.java
Demonstrates how to use a SAML token to login to a vCenter server. See LoginByToken Example (JAX-WS).
SDK/ssoclient/java/JAXWS/samples/com/vmware/vsphere/soaphandlers/
HeaderCookieExtractionHandler.java
Extracts the vCenter HTTP session cookie from the response to a connection request.
HeaderCookieHandler.java
Inserts an HTTP cookie into a request.