Note that there are some explanatory texts on larger screens.

plurals
  1. PO403 Error with WiFi Hotspots
    primarykey
    data
    text
    <p>I have an iOS app that connects to a Django server via XMLRPC (the protocol doesn't really matter). Authentication is persisted with standard cookies and is transparently handled by <code>AFNetworking</code> via <code>NSURLConnection</code>. The Django XMLRPC library returns a <code>403</code> error when a request fails authentication, and when this happens the app displays a login page to the user. This approach has worked fine for a few years.</p> <p>A recent problem came up with a user who connected to a WiFi hotspot but did not authenticate with the hotspot. They loaded the app and was shown the login page, which must have been the result of a <code>403</code> error coming back from the hotspot. If they first authenticate with the hotspot then everything works fine.</p> <p>I'm trying to find a solution to prevent my app from interpreting such <code>403</code> errors as a failed authentication. I assume one of two things are happening:</p> <ul> <li>the hotspot redirects to a URL that returns a <code>403</code> error; or</li> <li>the hotspot immediately returns a <code>403</code> error.</li> </ul> <p>The first scenario is easy to manage by blocking <code>301</code> and <code>302</code> redirects. Fortunately, <code>AFNetworking</code> makes this easy.</p> <p>The second scenario is more difficult and I see no way of knowing from where the <code>403</code> originated.</p> <p>Does anyone know if there is anything else in the header to detect the origin of a <code>403</code>, or if there is a standard practice of redirecting the request when not signed into a hotspot?</p> <p><strong>Edit</strong></p> <p>Here are what my Django service header looks like on a <code>403</code>:</p> <pre><code>HTTP/1.1 403 FORBIDDEN Server: nginx Date: Sun, 28 Apr 2013 07:21:34 GMT Content-Type: text/html; charset=utf-8 Content-Length: 0 Connection: keep-alive Vary: Cookie Set-Cookie: sessionid=5a5ce154d1229e40c3773e8f6999a32d; expires=Sun, 18-Aug-2013 07:21:34 GMT; httponly; Max-Age=9676800; Path=/ </code></pre>
    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.
 

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