--
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-talk+unsubscribe@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/2ac642d6-4c9c-405e-8ec9-fe0ff7b22a98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hey Joe,You are probably looking for the Firebase Admin Node.js SDK, which allows you to authenticate with a service account and get admin access to your Realtime Database. Check out that link and it'll walk you through how to authenticate the Admin SDK.Cheers,Jacob
On Wed, Dec 7, 2016 at 6:19 PM, Joe P <jmp...@gmail.com> wrote:
Hi,is there anyway to authenticate to Firebase with a Service Account so that the .gs file can be run from a Google Sheet ?we can get a token with egvar token = FirebaseApp.getDatabaseByUrl(firebaseURL).createAuthToken()but that token can't then be used to authenticate viaFirebaseApp.getDatabaseByUrl(firebaseURL, token)it seems we can only use our Firebase Database secret but those have been deprecated.FirebaseApp.getDatabaseByUrl(firebaseURL, secret)How long is it safe to use the secret for? presumably deprecated features will be removed at some point?thanksJ.
--
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 unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@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/96a0ad42-2850-4970-a6c8-56b11856bd81%40googlegroups.com.

--
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-talk+unsubscribe@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/99d681d7-837c-4c9f-a387-0fd6c743a5b1%40googlegroups.com.
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.
--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/-RKpHaMPTYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@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/760fbcb7-437f-478c-aed8-740396afc369%40googlegroups.com.
function makeToken(){ var firebaseUrl = "https://example.firebaseio.com/"; var secret = "EXAMPLEKEYYEKELPMAXE"; var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, secret); var token = base.createAuthToken(Session.getActiveUser().getEmail()); return token; }
// ALSO WORKED USING THE SAMPLE PROVIDED
function writeDataToFirebase() { var ss = SpreadsheetApp.openById("1rV2_S2q5rcakOuHs2E1iLeKR2floRIozSytAt2iRXo8"); var sheet = ss.getSheets()[0]; var data = sheet.getDataRange().getValues(); var dataToImport = {}; for(var i = 1; i < data.length; i++) { var firstName = data[i][0]; var lastName = data[i][1]; dataToImport[firstName + '-' + lastName] = { firstName:firstName, lastName:lastName, emailAddress:data[i][2], country:data[i][4], department:data[i][5], weight:data[i][6], birthDate:data[i][7] }; } var firebaseUrl = "https://example.firebaseio.com/"; var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, "EXAMPLEKEYYEKELPMAXE"); base.setData("", dataToImport);{ "rules": { "users": { "$user_id": { ".write": "$user_id === auth.uid", ".read": "$user_id === auth.uid" } } }}