Baby steps with authentication - do I need to change the method calls or query from the client?

178 views
Skip to first unread message

Sherm Mohler

unread,
Nov 27, 2023, 10:21:00 AM11/27/23
to Firebase Google Group
 Hello!

Working on a new project, code-named "GlyphPass" based upon a patent I received earlier this year. I am trying to use Firebase to synchronize content across devices, and I have had pretty good luck with firestore  (uploading and downloading data) with no ACL's involved... again baby steps!

I have started using the email/pw authentication for now I am using the classic:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

However, even though I have sucessfully authenticated, and I put the same firestore query in the auth listener for a successful authentication:

       val pulledUsers = db.collection("users")
            .get()
            .addOnSuccessListener { result ->
                for (document in result) {
                    // Log.d("TAG", "${document.id} => ${document.data}")
                    Log.d("TAG", "First name => ${document.data.get("first")}")
                }
            }
            .addOnFailureListener { exception ->
                Log.w("TAG", "Error getting documents.", exception)
            }

it fails with : "PERMISSION_DENIED: Missing or insufficient permissions"

Do I need to modify the query in any way? Suprisingly, I am not seeing any documentation on that (of course I may be overlooking it). I am assuming that it's not an issue with the fact I am currently on the "spark" (free) plan while I build the App.

One last thing; I noticed I can't kill and run my app to re-test very often; how long after an initial authentication will you be blocked from authenticating again?

Thanks!

-- Sherman

Sherm Mohler

unread,
Dec 28, 2023, 11:23:03 AM12/28/23
to Firebase Google Group
All,

A month later I am still completely stuck, and not a single person (get Googlers are you out there?) has bothered to help. I have now run into another interesting problem, where even if I leave the database wide open (allow read, write: if true) an authenticated user cannot insert data,  but a non-authenticated app can! I am definitely missing something probably obvious, and I wish I could get a little help here!

Reply all
Reply to author
Forward
0 new messages