1

We are using vSphere web client SDK 6.0 (HTML bridge) and trying to retrieve session with com.vmware.vise.usersession.UserSessionService.getUserSession().

for code sample you can refer vsphere-wssdk example from vsphere-client-sdk\html-bridge\samples.

After injecting this interface in class VmDataProviderImpl, it will return proxy object of UserSessionService and _userSessionService.getUserSession() always returns null.

How will we get current logged in user session of vSphere web client with vim25.

Please advise.

Mayur Bhokase
  • 377
  • 4
  • 19

1 Answers1

3

_userSessionService.getUserSession() can return null in a number of cases:

  • you are calling the method from outside of an HTTP-handling thread (http-bio--exec-XXX in Tomcat). The behavior is like this since there is no way to understand what is the user that initiated the action.
  • you are calling the method inside an HTTP-handling thread but the plugin does not have its WAR's session properly set up - for example if you've forgotten to define a SessionManagementFilter inside your WAR's web.xml.
Dimitar Dimitrov
  • 16,032
  • 5
  • 53
  • 55
tony.ganchev
  • 596
  • 4
  • 14