Reputation: 524
I have the port forwarded, I've checked here:
I can get the cookie, however using the this logic(that works for local networks):
Get cookie
Get token using the cookie and authentication
Use token to call WEBAPI actions
The problem is that I cannot even get the token.
I get this error : FileNotFoundException
The same IP, port and link works fine in my browser, making me think there is either a problem with authentication or something with the cookie.
String authorization = "Basic " + new String(android.util.Base64.encode((auth).getBytes(), android.util.Base64.NO_WRAP));
That is then used like this:
connection.setRequestProperty("Authorization", authorization);
The HTTP response is : HEADER FIELDS{null=[HTTP/1.1 400 ERROR], Connection=[keep-alive], Content-Length=[17], Content-Type=[text/html], X-Android-Received-Millis=[1484153865632], X-Android-Response-Source=[NETWORK 400], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1484153865562]}
There shouldnt be an error at this point. I really dont get how it could be a bad request when connecting to a global IP but OK on a local connection.
So my question is. Should I authenticate differently when connecting to a global IP? How? Like always, the documentation is of no help at all.
Upvotes: 0
Views: 45
Reputation: 524
No idea what was wrong. But setting up a new port at 8080, which could be used as an inside and outside port worked.
Upvotes: 0