osayouba / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

Why prompt for credentials when already entered #398

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Even if users enter their credentials in the prefs screen, a prompt always 
appears on the first request after ODK is opened. This is both confusing and 
slows things down as two request/responses must take place instead of one. Is 
there any reason for the prompt or could we just send the saved credentials 
with the first request and only show the dialog if there is an auth failure?

Original issue reported on code.google.com by yanokwa on 30 Oct 2011 at 3:49

GoogleCodeExporter commented 9 years ago
bug from 
https://groups.google.com/d/topic/opendatakit-developers/GHqZqrOZJGg/discussion

Original comment by yanokwa on 30 Oct 2011 at 3:54

GoogleCodeExporter commented 9 years ago
the way it works is that everything server needs auth (or auth is wrong), we 
pop up a dialog pre-populate with the values from the phone's credentials. 

if you want to work around this, you could only pop up the dialog when you 
don't have a username/password in the credentials, but you have to careful to 
only bypass the dialog a few times or you'll be in an infinite loop.

i don't know if the server returns 'need password' vs 'incorrect password', but 
that'd make this easier. mitch can clarify if this is possible..

Original comment by yanokwa on 2 Nov 2011 at 9:24

GoogleCodeExporter commented 9 years ago
The server will just send a 401 Unauthorized response with a WWW-Authenticate 
header that says what types of authentication it is willing to accept from the 
client.

It is stateless on the server side -- it doesn't care whether you didn't 
specify a credential or entered a bad one.  If, however, you do enter a valid 
login, the server can then return 403 Forbidden, indicating that the credential 
was good, but doesn't have the proper permissions for the webpage.

Original comment by mitchellsundt@gmail.com on 3 Nov 2011 at 12:31

GoogleCodeExporter commented 9 years ago

Original comment by yanokwa on 26 May 2012 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by yanokwa on 26 May 2012 at 1:14