title: Authenticate on fat free framework with basic http authentication, how?
body: <p>I have <strike>two</strike> one question about the Fat Free Framework. </p>
  
  <p><strike>First of all, how can i use multiple parameters(tokens in fat free framework) in a GET request?
  Or, is there only 1 token possible per REST GET request, and should one handle additional
  arguments as a regular GET request, for example:</p>
  
  <pre><code>domain/rest/somedata/5231?param1=value1&amp;param2=value2
  </code></pre>
  
  <p>where the ?param1=value1&amp;param2=value2 should be 'manually' parsed, not by a framework?</strike></p>
  
  <p><strike>Is it at all possible to build a RESTful API with Fat Free Framework and also have some area's or routes needing authentication? if so, how?</strike></p>
  
  <p>I just stumbled upon this related question: <a href="https://stackoverflow.com/questions/4024271/rest-api-best-practices-where-to-put-parameters/4026505#4026505">REST API Best practices: Where to put parameters?</a></p>
  
  <p><strong>[edit]:</strong> i've found out that it is indeed possible to have authentication with fat free framework using several methods. However, they seem not very well documented (at least not on their github wiki).</p>
  
  <p><strong>[edit2]</strong> Since it's only very basic authentication, for now i'm using this:</p>
  
  <pre><code>function beforeRoute($f3,$params) {
      $url = $params[0];
      $parsed_key = parse_str(parse_url($url, PHP_URL_QUERY));
  
      if (isset($apikey)){
          // check if apikey is in database
          $authenticated = false;
          foreach(R::find('apikey') as $key_bean) {
              if($key_bean-&gt;key == $apikey) {
                  $authenticated = true;
                  break;
              }
          }
          if($authenticated == false) $f3-&gt;error(403);
      } else {
          $f3-&gt;error(403);
      }
  }
  </code></pre>
  
  <p>I'm looking for documentation on the basic http authentication method!</p>