VMware {code} Community
huevan2017
Contributor
Contributor

Need Help, Can not run the demo code according to the SSO programming guide.

1) I have configured 2 vcenters, xx.xx.xx.180,  xx.xx.xx.182,  and the SSO server: xx.xx.xx.181, like this:

96547_96547.pngssss.png

2) according to  the programming guide(http://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/sso_prog_guide_6_0.pdf )  , we can get token from sso server, like this:

96549_96549.png1111.png

3)but i can't run the demo code, i got this error:

my command line: run.bat com.vmware.sso.client.samples.AcquireBearerTokenByUserCredentialSample https://192.168.21.181/sts/STSService username passs

96548_96548.png222.png

i don't understand why got this error, i can visit the sso url through: https://192.168.21.181/sts/STSService

96550_96550.png121212.png

I don't think i missed any steps,  pls  help  me,  thanks!!!

Reply
0 Kudos
1 Reply
doskiran
Enthusiast
Enthusiast

I tried the same operation it works for me using build "5638405"(6.5.0).

Same steps like:

1) Copied and unziped the VMware-vSphere-SDK-6.5.0-5638405.zip in C: drive

2) Open command prompt and set JAVAHOME ("set JAVAHOME="C:\Program Files\Java\jdk1.8.0_131")

3) Run the command,

> C:\VMware-vSphere-SDK-6.5.0-5638405\SDK\ssoclient\java\JAXWS> run.bat com.vmware.sso.client.samples.AcquireBearerTokenByUserCredentialSample https://10.10.xx.xx/sts/STSService Administrator@vsphere.local  password

Output::

Aquiring a bearer token by using user credentials

Token details:

        AssertionId = _6ba49c4d-0fc6-4721-9ee7-79beb6062339

        Token type = Bearer

        Issued On = 2017-07-03T09:01:32.113Z

Done.

I am thinking it may failed because of some TLS connection, its better to add " -Dhttps.protocols="TLSv1,TLSv1.1,TLSv1.2" "  at the end of the command and try.

i.e,

> C:\VMware-vSphere-SDK-6.5.0-5638405\SDK\ssoclient\java\JAXWS> run.bat com.vmware.sso.client.samples.AcquireBearerTokenByUserCredentialSample https://10.10.xx.xx/sts/STSService Administrator@vsphere.local  password -Dhttps.protocols="TLSv1,TLSv1.1,TLSv1.2"

Reply
0 Kudos