I would like to access my Firebase database from web:
Config copied from console:
var config = {
apiKey: "AI***********************************98",
authDomain: "t*****.firebaseapp.com",
databaseURL: "https://t*****.firebaseio.com",
projectId: "t*****",
storageBucket: "t*****.appspot.com",
messagingSenderId: "224202513016"
};
firebase.initializeApp(config);
However calling:
firebase.database().ref('/calibration/temperature').once('value').then(function(snapshot) {
console.log(snapshot);
});
Results in:
Uncaught (in promise) Error: permission_denied at /calibration/temperature: Client doesn't have permission to access the desired data.
My rules in DB:
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
I've tried to use different API keys, or restrict them to specific web page - unfortunately with no luck.