Skip navigation
VMware
Up to Discussions in VMware vCloud™ API

Developer: VMware vCloud™ API

Open. Extensible. Pure Virtual.
 

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
677 Views 2 Replies Last post: Apr 25, 2011 10:18 AM by cfor RSS
geoffaviarc Novice 18 posts since
Sep 20, 2010
Currently Being Moderated

Mar 9, 2011 2:14 PM

ScreenTicket returned from vCloud API appears to be invalid

Hi

 

I'm trying to open the remote console plugin to access vm consoles in the browser.

 

I make a rest call to

https://10.0.11.31/api/v1.0/vApp/vm-273392803/screen/action/acquireTicket

 

which returns

<ScreenTicket xmlns="http://www.vmware.com/vcloud/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1 http://10.0.11.31/api/v1.0/schema/master.xsd">mks://10.0.11.43/vm-3218?ticket=TE-Q9%2B%2BXkIf4n6Ml60ojet7%2F1yQNLzvyknmwZHnbnVDuxbINMgQYDhXHwOMxCp7cbixPsnoOuP9%2FcqJNtQjvTRuErle4ddi%2BaNt-pDLeMtRtl8EVz2QGJzYRRIbn1mGoS0JCzt8TjWOrHKjhIc6v1ww4irTxXeUWRNT76r%2FxmieL5qHJuNs0YJGTOKmcpZ7DJmLbpIzd4qB9SUzbI6m9ltkiboGffBKRxQbwDsyEUHoW1j88kHyypXQNi3FfYfE%2BgIR7OgeibIz2nG0%3D</ScreenTicket>

 

from this String i extract the host, ticket and vm args required for the browser object....  the ticket part of the string appears to be URL encoded so i decode it then I push this to the browser and then use this code to launch the console.

 

<object id="mks" type="application/x-vmware-vmrc;version=2.5.0.279773"></object>

<script>

        var obj = document.getElementById('mks');
var ret = obj.connectWithSession('10.0.11.43', 'TE-Q9++XkIf4n6Ml60ojet7/1yQNLzvyknmwZHnbnVDuxbINMgQYDhXHwOMxCp7cbixPsnoOuP9/cqJNtQjvTRuErle4ddi+aNt-pDLeMtRtl8EVz2QGJzYRRIbn1mGoS0JCzt8TjWOrHKjhIc6v1ww4irTxXeUWRNT76r/xmieL5qHJuNs0YJGTOKmcpZ7DJmLbpIzd4qB9SUzbI6m9ltkiboGffBKRxQbwDsyEUHoW1j88kHyypXQNi3FfYfE+gIR7OgeibIz2nG0=','vm-3218', 2);
</script>
the object loads and the remote console app loads but I get and invalid ticket error.
Am I doing things correctly or is the vcloud API giving me invalid tickets?
jake.robinson… Enthusiast 125 posts since
Jul 23, 2008
Currently Being Moderated
1. Mar 17, 2011 9:36 PM in response to: geoffaviarc
Re: ScreenTicket returned from vCloud API appears to be invalid

The only thing I can think of is the 30 second ticket lifetime. After that, the ticket becomes invalid.

Jake Robinson VCP, vExpert - http://geekafterfive.com
cfor Hot Shot 216 posts since
May 8, 2009
Currently Being Moderated
2. Apr 25, 2011 10:18 AM in response to: geoffaviarc
Re: ScreenTicket returned from vCloud API appears to be invalid

One issue we have seen before was using .NET for rest and the screen ticket.  The ticket that comes back this way can not be used directly.  You must Url.Decode it first, then use the decoded ticket, and that works.  (Also as said before, you get 30 seconds to use the ticket from when it is created)

ChrisF (VCP4, VCP5) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

Bookmarked By (0)

Communities