title: Solution to RESTFul authentication over HTTPS
body: <p>therez really a lot of discussion on the web for authentication is REST Architecture, so i think its a high time we place the solution at one place.A solution that sound somewhat ok:</p>
  
  <p>(Security professionals out there, plz comment)</p>
  
  <ol>
  <li>The user log in using his username and password</li>
  <li>On the server, username and password is validated</li>
  <li><p>if credentials are valid, we get a unique id by mixing a timestamp with the userid. we use a table for mapping uniqueId->userid and we make an entry for the unique id we just generated and the userid</p></li>
  <li><p>Also, we set an HTTP header say id containing the unique id and the userid somewhat with string concatenation  like this <code>&lt;uniqueId&gt;#&lt;userid&gt;.</code></p></li>
  <li><p>On every request the client must supply this info,</p></li>
  <li><p>if a request from the client require us to identify who the client is so that we can check his permissions, then we do this:</p></li>
  </ol>
  
  <p>get http header  #,</p>
  
  <p>if not contain invalid user</p>
  
  <p>if contain check in database if mapping uniqueId->userid exist</p>
  
  <p>if yes we have identified the user else invalid user</p>
  
  <p><strong>The whole of this scheme is on HTTPS</strong></p>