Package com.vmware.sso.client.samples
Class AcquireHoKTokenByUserCredentialSample
- java.lang.Object
-
- com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample
-
public class AcquireHoKTokenByUserCredentialSample extends java.lang.ObjectThis sample illustrates acquiring a Holder-Of-Key token from SSO server by passing the username and password of the user along with using the user's private key and certificateUsage: To use a pre-generated key/certificate pair use: run.bat com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample [sso url] [username] [password] ****OR***** To load the key/certificate pair from individual files use: run.bat com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample [sso url] [username] [password] [path to key file] [path to certificate file] ****OR***** To load the key/certificate pair from a keystore use: run.bat com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample [sso url] [username] [password] [path to keystore file] [keystore password] [alias used in keystore]
Users can generate their own pair of private key and certificate using the keytool utility shipped with the jdk. Sample usage of the keytool to generate a pair would be as follows:> keytool -genkey -keyalg RSA -alias sample -keystore sampleKeystore.jks -storepass sample What is your first and last name? [Unknown]: *.vmware.com What is the name of your organizational unit? [Unknown]: Ecosystem Engineering What is the name of your organization? [Unknown]: VMware, Inc. What is the name of your City or Locality? [Unknown]: Palo Alto What is the name of your State or Province? [Unknown]: California What is the two-letter country code for this unit? [Unknown]: US Is CN=*.vmware.com, OU=Ecosystem Engineering, O="VMware, Inc.", L=Palo Alto, ST= California, C=US correct? [no]: yes Enter key password for <sample> (RETURN if same as keystore password):
-
-
Constructor Summary
Constructors Constructor Description AcquireHoKTokenByUserCredentialSample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.ElementgetToken(java.lang.String[] args, java.security.PrivateKey privateKey, java.security.cert.X509Certificate userCert)static voidmain(java.lang.String[] args)
-
-
-
Method Detail
-
getToken
public static org.w3c.dom.Element getToken(java.lang.String[] args, java.security.PrivateKey privateKey, java.security.cert.X509Certificate userCert) throws javax.xml.datatype.DatatypeConfigurationException- Parameters:
args-Stringarray containing the following values in the below order:- SSO server url
- username
- password
privateKey-PrivateKeyof the useruserCert-X509Certificatecertificate of the user- Returns:
- A Holder-Of-Key token
- Throws:
javax.xml.datatype.DatatypeConfigurationException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-