Questions tagged [firebase-security]

The Firebase Security API uses a flexible authentication system and an expression-based rules language to provide a very flexible security model.

Filter by
Sorted by
Tagged with
1 vote
1 answer
43 views

Need help catching firebase user permission error on flutter

I am really confused about this permission-denied exception that is being thrown but I cannot catch it no matter what I do. Here is my function: Future<bool> uploadDataToStorage(String user, ...
1210saad's user avatar
0 votes
1 answer
26 views

In firestore rules, how to convert int value to string with left padding zeros?

In firebase rules, I am converting a month to 2 char string to access a document. For eg, when converting let var = string(3) I want to get "03". Instead I get 3. I can't locate anything for ...
knotmine's user avatar
0 votes
0 answers
41 views

Auth Permission denied

This error occur when I debug only in android simulator and real device. W/Firestore( 2910): (24.9.1) [Firestore]: Listen for Query(target=Query(categories order by id, name);limitType=LIMIT_TO_FIRST)...
Ko Oo's user avatar
  • 1
0 votes
1 answer
25 views

Why don't my Firebase Firestore rules allow access when I use a document path?

I am developing an Android app, and using Firebase Auth and Firestore. When I try and write specific rules for the Firestore database, access is denied when I test the app. When The Firestore Rules ...
ReachTheBlueDot's user avatar
1 vote
1 answer
30 views

Firebase rule "resource.data.uid" dont work with a stream

currently I am implementing the firebase rules into my project. I implemented reading and writing and it works really well. My problem right now is a stream in combination with the rule "resource....
Nice2Meet Work's user avatar
1 vote
1 answer
55 views

Firebase: Rule to prevent changes after a deadline

I have created wild Firebase rules and would like to add another check to them. I want to check two specific fields that can only be changed by the user if they are before the deadline. The deadline ...
borsTiHD's user avatar
  • 295
0 votes
2 answers
43 views

ways to hacker can access my Firebase Database?

I know anyone can see database url from google-services.json in android application just by extract apk. I think, If we hide childName reference of db then hacker can not access database. Or any other ...
TexD's user avatar
  • 194
0 votes
1 answer
35 views

Firebase Realtime Database to restrict changing specific field

I got the following problem: multiple users can press a button and I need to catch only the first one pressed when it's allowed. Right now, my security rule looks like this: "details": { &...
kuznikowski's user avatar
0 votes
0 answers
29 views

How do I check for a certain type of value in Firebase security rules when I am setting an object? [duplicate]

I am creating a function that will check if the > resource.data.dataObj will have certain keys in it as well as will check if the incoming values is a bool... the hasOnly only fails to check for ...
Richardson's user avatar
  • 1,962
-2 votes
0 answers
32 views

Couldn't initialize the firebase-tools

I tried installing firebase-tools using the following command: npm install -g firebase-tools It seems to download and get to the end successfully. The command outputs the following: changed 672 ...
Raffay Elahi's user avatar
0 votes
0 answers
40 views

Firebase storage authentication issue [duplicate]

Some users of the web app I'm developing are having issues with accessing Firebase storage. I'm not exactly sure what the problem is but looking on their browser dev tools it seems that they get a ...
cicotuco's user avatar
0 votes
0 answers
22 views

Missing or insufficient permissions. FirebaseError: [duplicate]

I am working on this React social media clone app from "https://www.youtube.com/watch?v=ELyjd5OXZKI&t=11879s"; I keep getting this error: ERROR Missing or insufficient permissions. ...
radgeek's user avatar
  • 23
0 votes
0 answers
11 views

Firebase Uncaught (in promise) FirebaseError: Missing or insufficient permissions [duplicate]

I've had a website in production for a year now, and permissions have never been a problem. All of a sudden today, I get the following error upon the first database query on the dashboard. ...
Spencer Brereton's user avatar
0 votes
1 answer
33 views

firestore/permission-denied. The caller does not have permission to execute the specified operation react native expo [duplicate]

Am developing react native app when I change my security rule I get the above error. I follow almost all the solution to the similar questions but am still getting this error. Here is my code ...
A. Lawal's user avatar
3 votes
1 answer
272 views

Firestore permission denied even with rules set to allow all

I have a simple React application that uses firebase as the backend. It was working fine until 2 hours ago when it started giving "code=permission-denied" on data reads. It does start ...
Hammad Ul Haque's user avatar
1 vote
2 answers
27 views

how can i write firestore rules to accomodate a multi user tree data structure? -- think sharable todo items with subitems

The firestore data represents a collection of artifacts. Each artifact has a usersIds field (more about this later) and a parentId field that is null (if this is a root artifact) or hold an id to ...
João Melo's user avatar
1 vote
1 answer
32 views

Does Firestore allow using exists() in security rules for collection groups?

Does Firestore allow using exists() in security rules for collection groups? Using the rules playground, I get this error: Error running simulation — Error: simulator.rules line [36], column [22]. ...
jvhang's user avatar
  • 767
0 votes
0 answers
20 views

Firestore rules unit test throws "Transaction lock timeout." error

I am setting up my firestore rules unit test environment, But there have some issue, If I initialize testEnv = await initializeTestEnvironment in every test file(Basically I just test 5 file with same ...
flutroid's user avatar
  • 1,260
1 vote
2 answers
58 views

Firestore security rules limit of 1000 evaluations per request

I recently run into this limit. After some optimisations I was able to get within the limit but now I've got several questions. Is that true that the number of expressions for the particular request ...
vir us's user avatar
  • 10.2k
0 votes
1 answer
34 views

Why is getDocs Function not Consistently Retrieving Firestore Data?

I'm currently working on a project that involves fetching data from a Firestore database using Firebase in a React application. The specific problem I'm encountering is with the getDocs function, ...
Saubhagya Ashish's user avatar
0 votes
1 answer
28 views

Firestore security rules: functions and if statements

Stuck with security rules. I have custom claims for roles like this: request.auth.token.accessRules[ownerId].roles In my case not every user has accessRules and not every user has roles for the ...
vir us's user avatar
  • 10.2k
0 votes
0 answers
26 views

Preventing Duplicate emails in Firebase Users Table [duplicate]

Firbase User Table Data bet:0 email:"[email protected]" image:"https://lh3.googleusercontent.com/a/ACg8ocK14K75GAfY9OgIU3vl93QaGMQCn4Y90Hu8Nk4I8SEQ=s96-c" name:"balal 442"...
Ali Yaghi's user avatar
1 vote
1 answer
29 views

Firestore Rule on Sub Collection

I am having a members sub collection under a branch collection. My firestore rules always fail when i try to get the members from the subcolection of a branch. Rules playground works but the actual ...
kcodem01's user avatar
0 votes
1 answer
36 views

How to tell what is causing a "missing or insufficient permissions" error in Firestore

I'm working on a social media application where users can create posts and post them on a public feed. Users are able to block other users. Blocked users cannot see the posts of the blocker, and the ...
Luca's user avatar
  • 183
0 votes
1 answer
35 views

Firebase Storage: User does not have permission to access 'images/myimg.jpg'. (storage/unauthorized)

I'm using firebase within my vue project. I have a section where I can upload images to firebase storage. I setup a method that allowed me to upload an image which worked great but once I set the ...
user2367177's user avatar
0 votes
1 answer
29 views

Using trim in firebase storage bucket variable

I implemented a bucket for every user like this uid-media I want to allow a looged in user to read his files. So, for the bucket name: gm5as4lhjllw2cdfrtgyh-media function isMemberOf(bucket, UID) { ...
ZAky's user avatar
  • 1,239
1 vote
1 answer
21 views

Firebase Android ChildEventListener fires when denied by rules (RTDB)

I have a game where both clients have the ability to determine "game over" state by writing to a "gameover" node: - gameId - - gameUpdates - - gameover I am attaching a ...
hgh89's user avatar
  • 17
0 votes
1 answer
55 views

FirebaseError: Missing or insufficient permissions. (Firestore Web)

Environment: development w/ NextJS I have been developing with Firebase/Firestore under very lenient Firestore security rules andall of my functionality worked fine. I have defined new Firestore rules ...
Michael DeMiceli's user avatar
1 vote
1 answer
63 views

Permission error when accessing database/storage in firebase

I updated my code to 10.5.0 version of firebase in my web app (I'm using alternative approach which I got it from here), but I keep facing permission errors even though my code was working fine ...
Cedric Hadjian's user avatar
0 votes
1 answer
36 views

Firestore Security rules Get data from another collection

I am trying to write a security rule for firestore which compares the resource.data.EIDSTRING value to a the EIDSTRING value in the app_users collection for the request.auth.uid user. However, I ...
Kody Byrd's user avatar
0 votes
1 answer
30 views

Optional function parameter in firestore.rules

I have a function in my rules to check if a given field is not set or not set incorrectly upon creation: function isNotInitializingField(fieldName, defaultValue) { return resource == null && ...
Nestoro's user avatar
  • 797
0 votes
1 answer
14 views

Firestore security rules | Prevent from writing data if a counter is not greater than field stored in DB

With Firestore I would like to prevent writing a document if its counter value is not higher than the value already stored. counter is a field of the document that is increased every new writing. But ...
Fifi's user avatar
  • 3,361
0 votes
1 answer
29 views

Getting this firebase error: FirebaseError: [code=permission-denied]: Missing or insufficient permissions

Changed my firebase rules, to allow user data to be stored, however it did not work. I am also working with stripe. I've included firebase rules, my login component and initializing firebase in my app....
Izk's user avatar
  • 35
0 votes
0 answers
38 views

FireStore and FireStorage rules

I want to allow the user Crud access to a file, only if the folder name in firebase storage equals to user's email address, and access to FireStore documents only if collection name equals to user's ...
user20251764's user avatar
0 votes
1 answer
52 views

How to configure Firestore Rules when access via Cloud Functions

I'm (now) aware that Firestore Collection rules only apply when accessed via a Browser/App. They are not used when Firestore is accessed via a Cloud Function. While not ideal I can write my own checks ...
Kildareflare's user avatar
  • 4,640
0 votes
1 answer
40 views

Firebase rule to not allow users to delete data from another users

I am using firebase for a game, so I have this rule: { "rules": { ".read": true, ".write": "auth != null", "users": { ".indexOn&...
RGS's user avatar
  • 4,123
0 votes
1 answer
63 views

Is it possible to use different `firestore.rules` for the emulator?

I'm trying to run an end-to-end testing of my application with the Firebase emulator running to provide proper data and backend context. Because of my security rules, I cannot put data into the ...
Keunwoo Park's user avatar
1 vote
0 answers
14 views

Google extensible service proxy ESV_V2 support for AppCheck: X-Firebase-AppCheck

I was looking into ESP_V2 Support for OpenAPI features and did not see any integration with AppCheck header: X-Firebase-AppCheck. Does anyone know, is this possible to integrated with ESP_v2, ...
Xao's user avatar
  • 554
0 votes
1 answer
104 views

Firebase Firestore Permission denied: Missing or insufficient permissions

I am trying to change the current Firebase project of my app but when I try to create a new user (When creating a user with email and password it also creates a document in the firestore database) I ...
Swann's user avatar
  • 5
0 votes
0 answers
122 views

I cannot write or read data to/from the realtime database

When I have set the security rules to allow anyone to read and write, I still encounter the following error when running 'flutter run': [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled ...
teruya 's user avatar
0 votes
1 answer
32 views

How to collectionQuery from a subcollection with index configuration in Firebase? [duplicate]

I'm trying to get my events from my Firestore Database with the collectionGroup query, as I think this is the function that fits my use case best. In the following method below, I want to get all ...
Daniel Jancar's user avatar
0 votes
1 answer
39 views

Firestore security rules for Chat collection

I have an app where two users can send messages to each other. My Chat collection structure is as follows: Chat -lastSentMessage: text -dateOfLastMessage: date -users: [id1, id2] - array of ...
newbie coder's user avatar
-1 votes
1 answer
21 views

Firebase Cloud Storage Security Rules Restrict Custom Meta Data

I want to control what key user can create for custom meta data uploadBytes(ref, blob, { customMetadata: { a: 1 } } ) for example I want user to be able to create only key a I tried: allow create: if ...
Acid Coder's user avatar
  • 2,182
0 votes
1 answer
55 views

Firestore rule does not permit list operation

I have Firestore rules as such: rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { function isAuthenticated() { return request.auth.uid != null; } ...
Eray Erdin's user avatar
  • 2,779
0 votes
1 answer
31 views

Can not fix firebase security rules

I have a simple app, where a user A can send notifications (chat, like, comments) to another user B, and obviously, user B can receive and read these notifications. My firestore database collection ...
newbie coder's user avatar
0 votes
1 answer
42 views

Firebase Realtime Database Rules. Only creator can read data

This is my Database: { "categories": { "c-NgA8_ZDjEur3HowEFVD": { "create_date": 1696699144485, "creator": "Codw8lfHuDcUox1Xe4ima15OGXi1&...
Loscho19's user avatar
0 votes
1 answer
46 views

Firebase Realtime Database permission denied, what is auth?

TL;DR: Does AppAttest/DeviceCheck count as 'auth' in rules? I have a Swift iOS app, which stores its logs to Google Realtime Database, and I am unable to send any data to the database, with "...
Andrey Solovyov's user avatar
0 votes
1 answer
30 views

Flutter: Why My Firestore Rules Are Not Working?

I have the following firestore rules but they are not working. rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // This rule allows anyone with your ...
Dev_flutter's user avatar
-1 votes
1 answer
74 views

How do I change the rules in Firebase so each user have their own list of todos?

I'm new to programming and firebase, I created a todo app with react native and successfully connected firebase to store the todos, now I added authentication so I can create my profile to store my ...
Alessandro's user avatar
2 votes
1 answer
101 views

Firestore requests are erroring out with status: FirebaseError: Missing or insufficient permissions

My Firestore read requests are getting errored out. I believe that some sort of incorrect blacklisting has happened. Environment: development Purpose: To find a document in my Firestore collection ...
user6434902's user avatar

1
2 3 4 5
110