title: Authenticating Firebase with Angular.js and $.authwithPassword()
body: <p>I'm attempting the following code.  I'm able to authenticate a user by email/password when clicking "login", and get an object returned; but I don't understand what I'm missing to return the data that I'm trying to get from "items" and "alseCards". If I set the read and write to "true" they return data fine, just want to authenticate those with any user who is logged in.
  I feel it's  Security/Rule setting, but just getting started with Firebase and struggling.</p>
  
  <p>index.html</p>
  
  <p>
  </p>
  
  <pre><code>&lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.firebase.com/js/client/2.2.7/firebase.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.firebase.com/libs/angularfire/1.1.2/angularfire.min.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"&gt;
  &lt;/head&gt;
  
  &lt;body ng-controller="controller"&gt;
      &lt;div&gt;
          &lt;button ng-click="login()"&gt;Login&lt;/button&gt;
  
          &lt;p ng-if="authData"&gt;Logged in user: &lt;strong&gt;{{ authData.uid }}&lt;/strong&gt;
          &lt;/p&gt;
          &lt;p ng-if="error"&gt;Error: &lt;strong&gt;{{ error }}&lt;/strong&gt;
          &lt;/p&gt;
      &lt;/div&gt;
       &lt;h1&gt;Items&lt;/h1&gt;
      &lt;ul id="items"&gt;
          &lt;li ng-repeat="item in items"&gt;
               &lt;h2&gt;{{item.$id}}&lt;/h2&gt;
              &lt;ul id="inspections"&gt;
                  &lt;li ng-repeat="inspection in item.inspections"&gt;{{inspection.description}} on {{inspection.timeStamp}} by {{inspection.inspector}}&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
      &lt;script&gt;
  
      &lt;/script&gt;
      &lt;script&gt;
          var app = angular.module("app", ["firebase"]);
          app.controller("controller", ["$scope", "$firebaseArray", "$firebaseAuth",
                  function($scope, $firebaseArrary, $firebaseAuth) {
                      var ref = new Firebase("https://&lt;-testing-&gt;.firebaseio.com");
                      var auth = $firebaseAuth(ref);
  
                      $scope.login = function() {
                          $scope.authData = null;
                          $scope.error = null;
  
                          auth.$authWithPassword({
                                  email: "email@myemail.com",
                                  password: "alseTest"
                              }).then(function(authData) {
                                  console.log(authData)
                                  $scope.authData = authData;
                              }).
                          catch (function(error) {
                              $scope.error = error;
                          });
                      };
  
  
  
                      $scope.alseCards = $firebaseArrary(ref.child("alseCards"));
                      $scope.items = $firebaseArrary(ref.child("items"));
                  }
              ]);
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Security and Rules.json</p>
  
  <pre><code> {
    "rules": {
      "users": {"$user_id": {".write": "$user_id === auth.uid", ".read": "$user_id === auth.uid"}},
      "items": {".write": "auth !== null &amp;&amp; auth.provider === 'password'", ".read": "auth !== null &amp;&amp; auth.provider === 'password'"},
      "alseCards": {".write": "auth !== null &amp;&amp; auth.provider === 'password'", ".read": "auth !== null &amp;&amp; auth.provider === 'password'"}
    }
  }
  </code></pre>
  
  <p>Thanks ahead of time.</p>