I need to make a shallow rest call using javascript with firebases REST Api, in the past version I needed to pass the access token like this:
var authKey = ref.getAuth().token;
var s = firebaseUrl + '/.json?shallow=true&auth=' + authKey;
$http.get(s)
How do I do this now with firebase 3?
Since Firebase Authentication no longer persists the access token, your application will have to do so itself, if needed. The documentation is pretty clear now: firebase.google.com/support/guides/…
Add Firebase to your JavaScript project. Go to the Service Accounts page in your project's settings. Click Generate New Private Key at the bottom of the Firebase Admin SDK section of the Service Accounts page. The new service account's public/private key pair is automatically saved on your computer.
Add Firebase to your JavaScript project. Go to the Service Accounts page in your project's settings. Click Generate New Private Key at the bottom of the Firebase Admin SDK section of the Service Accounts page. The new service account's public/private key pair is automatically saved on your computer. Copy this file to your authentication server.
This magical solution is called Firebase. The Firebase authentication library which is a part of the overall platform makes life easier for both developers and users. As for users, it makes it simpler to register or log in to the app with just a simple click to connect with their social media accounts or the classic email and password solution.
firebase.auth().signInWithEmailAndPassword(u, p).then(function(result){
result.getToken().then(function(token){
$rootScope.userLoginToken = token;
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With