title: Best way to do authorisation through REST API using Lumen?
body: <p>I am making a simple REST API using latest stable version of Lumen. That API is going to be used in mobile applications, and there is one thing I'm not sure about.</p>
  
  <p>What is the best ( secure enough ) way to an authorization? At the moment I am doing a simple <code>POST</code> request to the server url like <code>http://api.example.com/v1/auth</code> with <code>username</code> and <code>password</code> parameters and return a JSON response like
  <code>{ "code" : 200, "message" : "OK", "access_token" : string }</code>
  or
  <code>{ "code" : 401, "message" : "Unauthorized" }</code></p>
  
  <ul>
  <li>Is JSON response a good solution?</li>
  <li>Is it better to return response code within header?</li>
  </ul>