title: Firebase server side auth with HTTP POST request using the firebase secret
body: <p>According to the firebase documentation, Firebase accepts all REST API types for authentication.  </p>
  
  <p><a href="https://www.firebase.com/docs/rest-api.html">REST API - Firebase authentication</a>
  In other words, PUT/POST/GET requests can all be used in a HTTP Request to authenticate authorization.  This is the example code:</p>
  
  <pre><code>curl \
  https://SampleChat.firebaseIO-demo.com/users/jack/name.json?auth=CREDENTIAL
  </code></pre>
  
  <p>The Firebase documentation also states:</p>
  
  <blockquote>
    <p>The argument can either be your Firebase Secret or an authentication
    token</p>
  </blockquote>
  
  <p>The POST request I'm sending is configured like this:</p>
  
  <pre><code>var Credential = "{\"auth:\", \"zXRLa7lybhJ21ZYqpXuqkT6YAYyySAGJ10lXInKy\"}";
  
  https://MyFirebaseName.firebaseio.com/.json?auth="+Credential
  </code></pre>
  
  <p>So, I want to use a POST request, with my Firebase Secret for server authentication.  My Security rule is:</p>
  
  <pre><code>{
      "rules": {
          ".read": true,
          ".write": "auth == 'zXRLa7lybhJ21ZYqpXuqkT6YAYyySAGJ10lXInKy'"
      }
  }
  </code></pre>
  
  <p>I'm getting an error returned from firebase that states:</p>
  
  <blockquote>
    <p>Invalid argument:
    "<a href="https://MyFirebaseName.firebaseio.com/.json?auth=">https://MyFirebaseName.firebaseio.com/.json?auth=</a>"zXRLa7lybhJ21ZYqpXuqkT6YAYyySAGJ10lXInKy"</p>
  </blockquote>
  
  <p>It seems like the <code>POST</code> request is actually getting through to Firebase, and Firebase is reading the data.  It's just that the argument isn't configured correctly. I've tried everything I can think of.  I'm not sure how the <code>CREDENTIALS</code> are supposed to be configured, and I can't find anything about it.  Maybe it should be something like:</p>
  
  <pre><code>{"auth": "The Secret Here"} 
  </code></pre>
  
  <p>I just tried that, and it won't accept it.</p>
  
  <p>I've also tried using:</p>
  
  <pre><code>{
      "rules": {
          ".read": true,
          ".write": "auth !== null"
      }
  }
  </code></pre>
  
  <p>In the hopes that no matter what I sent in the REST API would be accepted, but that didn't work.</p>
  
  <p>What am I doing wrong?  I've gone over the documentation many times, searched here, searched a Google group.  I can't figure it out.  I need to know the format, and the syntax for how the POST data gets sent in the CREDENTIALS.</p>