This topic contains 2 replies, has 2 voices, and was last updated by roho 8 years, 3 months ago.
HTTP API: Always new login session?
You must be logged in to reply to this topic.
This topic contains 2 replies, has 2 voices, and was last updated by roho 8 years, 3 months ago.
Hi, we are using the HTTP API to show the channel status and start/stop channels within another application. This application polls every 10 seconds using a query similar to http://localhost:6543/get_channel_config?UserName=blah&Password=blubb
.
Unfortunately, every polling leaves a message in the Iguana log, like this:
User "blah" has logged in from IP 127.0.0.1 with session 84B077B1999A09705309FF08DB7C11DC
We would like to avoid having all these messages in the log.
Is there a way to leave the session for the user open, so he can access Iguana again without having all the time new logins which generate this log message?
Yes. You could look at one of my older tips and tricks using the log api before it supported HTTP basic authentication.
Basically you simulate a login of a user and get a session cookie and then use that as your authentication mechanism. It should do the trick.
Hi Eliot,
as always, you have been very helpful, thank you!
In case anyone is interested, the solution is: First send a request to “http://localhost:6543/login.html?UserName=blah&Password=blub”. In .Net, use a CookieContainer to store the cookie you get from this.
Set this CookieContainer in the following requests, and the same session will be used without new login.
You must be logged in to reply to this topic.