Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is not necessarily a code solution to your problem, but may be helpful.</p> <p>When I'm approaching problems like this I need a way to see what the request headers to and from my app look like.</p> <p>I typically use Charles (great tool) <a href="http://www.charlesproxy.com/" rel="nofollow">http://www.charlesproxy.com/</a> for this. And no I don't have any connection to the company, it's just a great tool.</p> <p>There's a feature in Charles called a reverse proxy and basically it allows you to bounce traffic through Charles to your drupal server and you can inspect it as it flows to and from your app.</p> <p>Using charles you can sniff what a good request from your web browser looks like and then you can sniff what the requests from your android app look like. Compare the two and you can see where your app is badly shaping the request headers.</p> <p>The debug phase goes like this:</p> <p>Once you've got Charles set up, hit your drupal server a couple of times and inspect the structure of the request/response that you're seeing from the browser.</p> <p>Then hit your service a couple of times from the android app and note the differences. Maybe the cookie isn't going through, maybe it's malformed, maybe there's something else about the headers. This will let you see what you need to shoot for in order to get Drupal to accept the requests.</p> <p>SOME MORE INSTRUCTIONS -</p> <p>The reverse proxy will allow you to inspect traffic coming from your phone and going to your drupal site (including headers so you should see exactly what cookies are being sent). To get the reverse proxy set up, you'll need to go to reverse proxies under the proxy menu and add a new reverse proxy - the proxy will take traffic directed at your localhost:PORTNUM and re-route it to your drupal server. It'll log communications going in both directions. Also, you can hit your drupal service a couple of times from FireFox and watch how a web app authenticates so you know what you're aiming for.</p> <p>In order to see phone traffic, you'll need to be sure your phone is connected to the same network as your computer. Re-write your phone code so that it addresses its web requests to your local computer. If you've got everything configured correctly then Charles will pop up a messages asking you if it's ok to allow your phone to connect. After that you can see what's different about the headers you're sending from what the web server is sending.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload