Archived

This topic is now archived and is closed to further replies.

Ultima

ATTENTION WEBUI DEVELOPERS: Support token authentication

Recommended Posts

I have read through this, it is apparently in PHP and I am not familiar enough with it to translate to VB. Since my 2.21 has been working for a year and the change to 3.12 broke things, should I assume it is the fact that I am not implementing Cookies? When I call the token.html it only returns the token, not the other information in my VB and I don't see a similar method to perform the GET and obtain the Cookie.

Share this post


Link to post
Share on other sites

Never mind, I figured it out. Apparently in VB the calls are different to 2.x and 3.x. Once I resolved the json calls and added/omitted the cookie my program now works in both.

Share this post


Link to post
Share on other sites

I'm having some trouble with the API using PHP. My code:

$auth = compact('user', 'pass');
// here the response is correct$tokenHtml = http::get('http://localhost:8080/gui/token.html', array(), $auth);  
$doc = new \DomDocument();$doc->loadHTML($tokenHtml->body());$xpath = new \DOMXPath($doc);$token = $xpath->evaluate('string(//div[@id=token]/text()[1])');
$params = compact('token') + array('list' => 1);
// here i get "invalid request" $response = http::get('http://localhost:8080/gui/', $params, $auth);

The 2nd GET request URL looks like:

http://localhost:8080/gui/?token=0PS859GrwTDWmTONlkIx82-O1kRGHS3lLPCyB3tvGdnn9vwPHi4oxxEZ01AAAAAA&list=1

Is there any way I can find out the reason why this is an invalid request?

Share this post


Link to post
Share on other sites