title: Firestore C#: Missing or insufficient permissions
body: <p>I am currently exploring Firebase's Cloud Firestore in C# and has encountered with the error which I could not resolve after searching SO. It seems that the resources for Firestore in C# is quite limited: </p>
  
  <pre><code>"Status(StatusCode=PermissionDenied, Detail=\"Missing or insufficient permissions.\")"
  </code></pre>
  
  <p>My code so far:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          Console.WriteLine("Hello World!");
          Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "FirebaseCsharpTest.json");
  
          string project = "MyProjectId";
  
          FirestoreDb db = FirestoreDb.Create(project);
          Console.WriteLine("Created Cloud Firestore client with project ID: {0}", project);
  
          AddPerson(db).GetAwaiter().GetResult();
  
      }
  
      public static async Task AddPerson(FirestoreDb db)
      {
          CollectionReference collection = db.Collection("users");
          DocumentReference document = await collection.AddAsync(new
          {
              Name = new
              { First = "Ada", Last = "Lovelace" },
              Born = 1815
          });
      }
  }
  </code></pre>
  
  <p>I have checked on my Firebase console that the Firestore security rules are set to public (as of now, for testing sake). I have also ensured that the authentication <code>json</code> file is the right file generated from Google Developer Console as suggested in this <a href="https://stackoverflow.com/questions/48719868/accessing-google-cloud-datastore-locally-from-asp-net-throws-grpc-core-rpcexcept">post</a>. </p>
  
  <p>Is there something I'm missing?</p>
  
  <p>EDIT:
  My permissions on google cloud console:
  <a href="https://i.stack.imgur.com/9Bd2m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Bd2m.png" alt="enter image description here"></a></p>