0

I am trying to replace the default "Authentication Required" box that comes up with authentication with a custom form for a username and password in JQuery Mobile.I am currently using HTTP Digest that I found from a tutorial (http://www.php.net/manual/en/features.http-auth.php). I am using AJAX with JQuery mobile to load up a PHP resource that logs in to the system and have got it half working. What I've tried so far is:

'http://username:password@domain/resource/'

and

data:{username:'username',password:'password'},

These both work when I am viewing the website on my desktop however when I view it on a smartphone (tried on iPhone and S4) it will instead show the default "Authentication Required" box and not take any of the details I provide in my own custom form. I wanted to know what the problem could be as I am pulling my hair out over this.

Thanks

bob565
  • 77
  • 1
  • 6
  • I'm pretty sure the "authentication required" pop-up box is something that is more "browser-oriented", meaning that you will have different results/behavior across web-browsers (like most things in web development). A good analogy is just how you can't "alter" the appearance of a javascript alert() dialog (usually). Browsers have built-in interpretation of the HTTP Basic authentication (and it seems some of the desktop browsers supported customizing it, but the mobile ones not so much.) – Zerkz Dec 24 '13 at 16:46
  • Also, see http://www.sencha.com/forum/showthread.php?236526-API-Basic-Auth-HTTP-401-errors-and-suppressing-the-browser-prompt – Zerkz Dec 24 '13 at 16:48
  • Thanks for the reply, I couldn't find a way to get Digest to work on a custom form so ended up just using basic authentication as it worked with my own form. – bob565 Dec 26 '13 at 02:58

0 Answers0