How to make athentication work?

How do I make authentication work? what is wrong with my code? Any help appreciated

#include <SPI.h>
#include <Ethernet.h>
#include <WebServer.h>


byte mac[] = { 0x00, 0x09, 0x34, 0x15, 0x18, 0xEA }; //physical mac address
byte ip[] = { 192, 168, 10, 2 };                  // ip in lan
byte gateway[] = { 192, 168, 10, 3 };                  // internet access via router
byte subnet[] = { 255, 255, 255, 0 };  //subnet mask
                                      
byte sampledata=50;            //some sample data - outputs 2 (ascii = 50 DEC)             
int ledPin1 = 2;  // LED pin 1
int ledPin2 = 3;  // LED pin 2
int ledPin3 = 4;  // LED pin 3
int ledPin4 = 5;  // LED pin 4
int ledPin5 = 6;  // LED pin 5

EthernetServer server(80);

String readString = String(30); //string for fetching data from address

boolean LEDON1 = false; //LED status flag
boolean LEDON2 = false;
boolean LEDON3 = false;
boolean LEDON4 = false;
boolean LEDON5 = false;


void setup(){
//start Ethernet
  Ethernet.begin(mac, ip, subnet);
//Set pin 4 to output
  pinMode(ledPin1, OUTPUT); 
  pinMode(ledPin2, OUTPUT); 
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
//enable serial datada print  
  Serial.begin(9600);
}
void loop(){
// Create a client connection
EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
   if (client.available()) {
    char c = client.read();
    //read char by char HTTP request
    if (readString.length() < 30) 
      {
        //store characters to string 
        //-----readString.append(c);
          readString.concat(c);
      }  
        //output chars to serial port
        Serial.print(c);
        //if HTTP request has ended
        if (c == '\n') {
          
//------------LED 1
           if (readString.substring(6,11) == "L1=ON")
           {
             digitalWrite(ledPin1, HIGH);    // set the LED on
             LEDON1 = true;
           }
             else if (readString.substring(6,12) == "L1=OFF")
            {
             digitalWrite(ledPin1, LOW);    // set the LED OFF
             LEDON1 = false;             
            }
//------------LED 2
           if (readString.substring(6,11) == "L2=ON")
           {
             digitalWrite(ledPin2, HIGH);    // set the LED on
             LEDON2 = true;
           }
             else if (readString.substring(6,12) == "L2=OFF")
            {
             digitalWrite(ledPin2, LOW);    // set the LED OFF
             LEDON2 = false;             
            }  
            
//------------LED 3
           if (readString.substring(6,11) == "L3=ON")
           {
             digitalWrite(ledPin3, HIGH);    // set the LED on
             LEDON3 = true;
           }
             else if (readString.substring(6,12) == "L3=OFF")
            {
             digitalWrite(ledPin3, LOW);    // set the LED OFF
             LEDON3 = false;             
            } 
           
//------------LED 4
           if (readString.substring(6,11) == "L4=ON")
           {
             digitalWrite(ledPin4, HIGH);    // set the LED on
             LEDON4 = true;
           }
             else if (readString.substring(6,12) == "L4=OFF")
            {
             digitalWrite(ledPin4, LOW);    // set the LED OFF
             LEDON4 = false;             
            }  
           
//------------LED 5
           if (readString.substring(6,11) == "L5=ON")
           {
             digitalWrite(ledPin5, HIGH);    // set the LED on
             LEDON5 = true;
           }
             else if (readString.substring(6,12) == "L5=OFF")
            {
             digitalWrite(ledPin5, LOW);    // set the LED OFF
             LEDON5 = false;             
            }   
 
          // now output HTML data starting with standart header
          client.println F("GET /private/index.html HTTP/1.1Host: localhost");
          client.println ();
          client.println F("HTTP/1.1 401 Authorization Required");
          client.println F("Server: HTTPd/1.0");
          client.println F("WWW-Authenticate: Basic realm=\"Secure Area");
          client.println F("Content-Type: text/html");
          client.println F("Content-Length: 311");
          client.println F("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">");
          client.println F("<HTML>");
          client.println F("<HEAD>");
          client.println F("<TITLE>Error</TITLE>");
          client.println F("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">");
          client.println F("</HEAD>");
          client.println F("<BODY><H1>401 Unauthorized.</H1></BODY>");
          client.println F("</HTML>");   
          client.println ();
          
          client.println F("GET /private/index.html HTTP/1.1");
          client.println F("Host: localhost");
          client.println F("Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
          client.println ();
         
          //set background to yellow
          client.print("<body style=background-color:yellow>"); 
          client.println F("<h1><center>Welcome To Arduino Online Home Automation</center></h1>");
          client.println F("<font color='black'>");
          client.println F("
");

//--------LED 1 CONTROLL--------
          client.println F("<center><h2>Conrol Panel & Status Of the House</h2></center>");
          client.println F("<center><h2>LED 1</h2></center>");
          client.println F("<center><form method=get name=LED><input type=submit name=L1 value=ON method=get name=LED><input type=submit name=L1 value=OFF ></form></center>");      
          
            if (LEDON1)
            { 
             client.print ("<center><font color='green' size='3'> ON</center>");
            } 
            else 
            { 
             client.print ("<center><font color='red' size = '3'> OFF</center>");
            }
            client.println F("<font color='black' 
");

//--------LED 2 CONTROLL-------- 
          client.println F("<center><h2>LED 2</h2></center>");
          client.println F("<center><form method=get name=LED2><input type=submit name=L2 value=ON method=get name=LED2><input type=submit name=L2 value=OFF ></form></center>");     
       
            if (LEDON2)
            { 
            client.print ("<center><font color='green' size='3'> ON </center>");
            } 
            else 
            { 
             client.print ("<center><font color='red' size = '3'> OFF </center>");
            }
            client.println F("<font color='black' 
");
            
//--------LED 3 CONTROLL--------
          client.println F("<center><h2>LED 13</h2></center>");
          client.println F("<center><form method=get name=LED3><input type=submit name=L3 value=ON method=get name=LED3><input type=submit name=L3 value=OFF ></form></center>");      
          
            if (LEDON3)
            { 
          client.print ("<center><font color='green' size='3'> ON </center>");
            } 
            else 
            { 
             client.print ("<center><font color='red' size = '3'> OFF </center>");
            }
            client.println F("<font color='black' 
");
            
//--------LED 4 CONTROLL--------
          client.println F("<center><h2>LED 4</h2></center>");
          client.println F("<center><form method=get name=LED4><input type=submit name=L4 value=ON method=get name=LED4><input type=submit name=L4 value=OFF ></form></center>");
          
            if (LEDON4)
            { 
              client.print ("<center><font color='green' size='3'> ON </center>");
            } 
            else 
            { 
             client.print ("<center><font color='red' size = '3'> OFF </center>");
            }
            client.println F("<font color='black' 
");
            
//--------LED 5 CONTROLL--------
          client.println F("<center><h2>LED 5</h2></center>");
          client.println F("<center><form method=get name=LED5><input type=submit name=L5 value=ON method=get name=LED5><input type=submit name=L5 value=OFF ></form></center>");    
          
            if (LEDON5)
            { 
             client.print ("<center><font color='green' size='3'> ON </center>");
            } 
            else 
            { 
             client.print ("<center><font color='red' size = '3'> OFF </center>");
            }
            client.println F("<font color='black' 
");           
           
          client.println F("</body></html>");
          //clearing string for next read
          readString="";
          //stopping client
          client.stop();
            }
          }
        }
      }
    }