VMware Cloud Community
blanket
Enthusiast
Enthusiast

vRealize Orchestrator HTTP-REST Plugin and cookie management

I have an REST host which after a successful login sets a cookie to expire when "browser session closes".

Based on my observation so far, this means when I restart the Orchestrator service. I need to get rid of that cookie earlier, on demand.

Are there cookie management operations available for HTTP-REST plugin? Something like restHost.deleteAllCookies() or restHost.deleteCookie(id) - I haven't been able to find anything in the documentation.

Are cookies stored as plaint text files somewhere - something I could simply delete?

How else could I delete just this one specific cookie? Or send a request without cookie header?

request = restHost.createRequest(...)

request.setHeader('Cookie', null)

does not work...

Any other ideas?

Versions:

  • vRO 7.0.1.3533702
  • HTTP-REST plugin 2.0.1
Tags (2)
Reply
0 Kudos
3 Replies
blanket
Enthusiast
Enthusiast

Bump.... :// any other "sane" ideas out there? Smiley Happy

Reply
0 Kudos
manuelperrot
Enthusiast
Enthusiast

Hey,

I have the same issue and I can't find a solution either. (vRO7.2 with HTTP REST plugin)

The target HTTP REST API I'm communicating with is returning this when I successfully login:

"Set-Cookie: SMSESSION=kp2nm98jz..................."

This is then managed and stored directly by the vRO HTTP REST plugin and I can't find a way to change it.

So if the cookie expire, the target REST API is not happy and return:

"Set-Cookie:SMSESSION=LOGGEDOFF"

If I try to change it with a new cookie:

request = restHost.createRequest(...)

request.setHeader('Cookie', "SMSESSION=6cllNvnGfj/dD......")   (new valid cookie)

It is then added in the http request and not overwritten.

Here is the fiddler extract:

GET https://...... HTTP/1.1

accept: */*

Content-type: application/json

Cookie: SMSESSION=6cllNvnGfj/dD......

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)

Cookie: SMSESSION=LOGGEDOFF

So the target REST API is still not happy 😞

If I reconfigure the vRO REST Host, the stored cookie goes away but that's a bit annoying for automation.

Reply
0 Kudos
manuelperrot
Enthusiast
Enthusiast

Hi,

This is not very elegant, but here is a way to get rid of the cached cookie:

RESTHostManager.updateHost(RestHost)

Then you need to search the "new RestHost" to be able to use it. Starting from here:

RESTHostManager.getHosts()