title: Firebase simple login for authentication with the REST api
body: <p>I want to create a web app with AngularJS and Firebase but only some parts of the app need the 3-way binding Firebase offers. The other parts would work just finding binding only once to the current data without constantly updating it. In other words, a normal REST API would suffice.</p>
  
  <p>The <a href="https://thinkster.io/angulartutorial/learn-to-build-realtime-webapps/" rel="nofollow">Thinkster AngularJS-Firebase tutorial</a> shows how to use <code>$resource</code> to access this Firebase REST API. This approach does not require to open a concurrent connection to your Firebase and only fetches the current data without updating:</p>
  
  <pre><code>app.factory('Post', function ($resource) {
  
  return $resource('https://FIREBASE-URL.firebaseIO.com/posts/:id.json');
  });
  </code></pre>
  
  <p>Would it be possible to do these kind of requests after logging in to Firebase using the simple login service, but <strong>without</strong> keeping a Firebase connection open. For example:</p>
  
  <pre><code>//Does this already open a connection to FireBase?
  var ref = new Firebase('https://FIREBASE-URL.firebaseIO.com');
  
  //Login to FireBase
  ref.authWithPassword({
    email    : "bobtony@firebase.com",
    password : "correcthorsebatterystaple"
  }, function(error, authData) {
    if (error === null) {
      // Can we close the connection now while still leaving the user authenticated?
      Firebase.goOffline();
    } else {
      console.log("Error authenticating user:", error);
    }
  });
  </code></pre>
  
  <p>If I would make requests to the REST API now:</p>
  
  <ol>
  <li>Will Firebase recognize the <code>auth</code> variable?</li>
  <li>Does the authorization stay valid?</li>
  <li>Can I use this method to prevent the connection to stay open and use Firebase as a normal REST API?</li>
  </ol>
  
  <p>To make things a little bit more clear:</p>
  
  <ul>
  <li>I do not need a real-time backend, a simple REST backend will suffice</li>
  <li>I would like to use Firebase because it provides easy authentication methods</li>
  <li>If possible, I want to avoid using the Firebase SDK and only interact with my Firebase using the REST API</li>
  </ul>
  
  <p>In other words my question would be:</p>
  
  <p>Is it possible to authenticate users client side to use the security rules of Firebase while using Firebase as a REST API without using the SDK?</p>