summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2012-03-30 10:42:26 +1300
committerMike Beattie <mike@ethernal.org>2012-03-30 10:42:26 +1300
commitac4f628a58e99c38bd726ceb5bf47f804f97437d (patch)
treede9642fbd94d04ce0c8fc91a8852415e485c8d63
parente3d70cfc37f8481147423d4e2df5e1f89b461f8e (diff)
Begin adding Base64 support for http auth.
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r--HouseControl.ino4
1 files changed, 4 insertions, 0 deletions
diff --git a/HouseControl.ino b/HouseControl.ino
index 369f84d..9212d43 100644
--- a/HouseControl.ino
+++ b/HouseControl.ino
@@ -7,12 +7,14 @@
*/
#define WEBDUINO_FAVICON_DATA ""
+#define WEBDUINO_AUTH_REALM "DoorControl"
#include <Time.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <WebServer.h>
+#include <Base64.h>
#include <MemoryFree.h>
#include <EEPROM.h>
@@ -311,6 +313,8 @@ void doHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail
void configHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
+ //base64_encode((char*)buf1, "user:pass", 9);
+ //if (!server.checkCredentials((const char*)buf1)) { server.httpUnauthorized(); return; }
/* for a GET or HEAD, send the standard "it's all OK headers" */
server.httpSuccess("text/html; charset=iso-8859-1", "Content-Encoding: gzip\r\n");