Firebase Realtime Database Rules Denied Permission

I am registering user using Email/Password Sign-In-Method. So after successfully registration and loge in, I can't read and write my data in Firebase Real Time.

I'm new to Firebase so I can't really figure out what the main problem is or which steps I have missed.

This rule is obviously working fine:

       "rules": {
              ".read": "auth == null",
              ".write": "auth == null"

However, this rule is not working, although my user is already registered and has got a UID.

       "rules": {
              ".read": "auth != null",
              ".write": "auth != null"

It always shows the following error:

Exception occured while processing the request.

Request Data: {
 "Title":"hello World ",

Response: {
  "error" : "Permission denied"

What I currently want is to allow ANY registered user to read/write everybody's information, but it always denied the permission.


enter image description here

enter image description here

enter image description here

My implementation for getting Firebase Data. The error is also pointing to the this method.

  public async Task<List<Appointment>> GetUserAppointment(string userId)
            var appointments = (await Firebase.Child("Appointments")
              .OnceAsync<Appointment>()).Where(a => a.Object.UID == userId).Select(item =>
              new Appointment
                  UID = item.Object.UID,
                  AppointmentID = item.Object.AppointmentID,
                  Title = item.Object.Title,
                  Date = item.Object.Date,
                  Time = item.Object.Time,
                  Status = item.Object.Status,
                  ReasonText = item.Object.ReasonText

            return appointments;

Read more here:

Content Attribution

This content was originally published by Hashmat at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: