".read" : "root.child('SOME_ID').child('token').val() == auth.childToken",
".write" : "root.child('SOME_ID').child('token').val() == auth.childToken" var Firebase = require("firebase")
var ref = new Firebase(...
ref.authWithCustomToken(FBtoken,func...var Firebase = require("firebase")
Firebase.initializeApp(...
var child = Firebase.auth().signInWithCustomToken(FBtoken,func...//this token was created on the parent, sent to the child, and the child sends it back to add some data into firebase by the parent sever with admin access
var FbToken = tokenGenerator.createToken({uid: "user-1", userToken:"unique-token" });
//the parent gets data from firebase that the client doesnt have access to
var newData = getData();
//create a new firebase
var ref = new Firebase(FbRoot).child("/child_id");
//log in as the clientref.authWithCustomToken(FbToken, function(error, authData) { if(error){ console.log(error) } else{
//set some data as the client ref.set({data:newData},function(error){ if(error) console.log(error) console.log("success!!!") }) }});{
"clinetID":{
"childToken:"unique-token"
"data":"some data object(s)"
}
}Creating and verifying tokens is quite a bit different in the new SDK. You don't sign in using the custom tokens on the server. Those are for clients.
Instead, you just specify the uid you want to impersonate and use a service account.
For an overview of the processes, see here. For authenticating clients with custom tokens, see here.
For authenticating servers, see here and here.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/984c4e57-fb65-4dcd-b69f-397b51c9338d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.