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.
Url: https://App-Name-6ssd2.firebaseio.com/Appointments/-MUAG-CHWBFSv-Vrtsoc/.json?print=silent
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.
Screenshots:
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
}).ToList();
return appointments;
My implementation when a user SinUp for the first time.
public async Task<string> SignUpWithEmailAndPassword(string email, string password)
{
try
{
var signUpTask = await auth.CreateUserWithEmailAndPasswordAsync(email, password);
var user = signUpTask.User;
var token = await auth.CurrentUser.GetIdToken(false).AsAsync<GetTokenResult>();
await SendEmailVerification();
return token.Token;
}
catch (FirebaseAuthInvalidUserException e)
{
e.PrintStackTrace();
return string.Empty;
}
catch (FirebaseAuthInvalidCredentialsException e)
{
e.PrintStackTrace();
return string.Empty;
}
catch (FirebaseAuthUserCollisionException existEmail)
{
existEmail.PrintStackTrace();
return string.Empty;
}
}
In order to check whether a user is authenticated/verified or not, i did the debugging and as a result... I can see the same UID in my console as it is in Firebase -> Authentication -> Users.
Debugging GetUserAppointment(string userID) to check whether the current user is set.





Firebase.Child("Appointments").OnceAsync<Appointment>()).Where(a => a.Object.UID == userId)executes the condition server-side, so I recommend looking into queries here too: firebase.google.com/docs/database/unity/… - Frank van PuffelenFirebaseAuth auth = FirebaseAuth.Instance; var userId = auth.Uid;After login successfully I can see the exact same UID in my console as it is in Firebase -> Authentication -> Users. - Hashmat