Arduino Yun - Getting REST password to work with Web Page

Hi All, I am new to Linux and Yun and have used examples from the web to build a Yun web server that allows me to read/write to digital pins and also read analog pins. The web server uses REST commands and also JSON and CSS, I have also setup the YUN for a static IP. The web page works fine when I configure (via Luci) the REST API Access to "OPEN".

What I would like to do is to password protect the web page so that only authorized users will have access.

To do this I have tried setting the REST API Access to "WITH PASSWORD". When I do this and use a browser to access the web page (Example: "http://192.168.1.165/sd/MyWebServerProject/) the web page loads ok and then I get a pop-up box that ask for username and password, I then enter both.

The result of this is that nothing happens, all I see is the web page and it never gets updated and I can not send any commands. Using Console print to debug I find that within the arduino the client never gets connected. So it looks like the username/password does not work?

Form other post on this form I also tried to access the web page using the following with the same results that the client never gets connected within the arduino.

  1. http://Username:Password@192.168.1.165/sd/MyWebServerProject
  2. http://root:Password@192.168.1.165/sd/MyWebServerProject

Questions...

  1. Does the REST API password really work in that it has the same functionality as it does with "no password" it just requires username/password at first log in?

  2. If REST API password does not work then is there a easy way to configure the OpenWrt uHTTPd server to require username/password protection to access a web page, if so then does anybody have examples on how to configure it?

http://forum.arduino.cc/index.php?topic=284869.msg1999797#msg1999797

Using your instructions I set REST API ACCESS to "PASSWORD" and changed "server.listenOnLocalhost();" to "server.noListenOnLocalhost();".

Now when I access the web page I get a prompt to enter username and password and it works great!

Just to make it clear for others who might read this post...Username will be "root" and password will be what you defined when you configured your Yun, if you never changed it then default would be "arduino".

Thanks for the help!