Comments (10)
Interesting... Well feel free to re-open if you still have issues. Also Weezer rocks.
from firestoregoogleappsscript.
Awesome. This library rocks.
I've been having other problems with Google Apps Scripts in the last 24 hours. Namely, they suddenly haven't been able to find some of my functions and I've had to move them around in the Files browser panel. I'll let you know if I learn anything.
from firestoregoogleappsscript.
This seems to resolve the issue:
props.getProperty('private_key').replace(/\\n/g, '\n')
... but not sure if this is the best way to fix it.🤷
from firestoregoogleappsscript.
@3zzy @riverscuomo Say it ain't so! It seems the script properties escapes the field input, I got around this by storing the whole service account JSON object as a property i.e:
const serviceAccount = JSON.parse(PropertiesService.getScriptProperties().getProperty("service_account"));
const key = serviceAccount.private_key;
const clientEmail = serviceAccount.client_email;
from firestoregoogleappsscript.
Doesn’t help when you quote ;)
I’ll just regenerate the key.
from firestoregoogleappsscript.
As listed in the Configuration Template, you should ensure your key matches the format literally (improperly formatted newlines are a common issue).
I figure adding some validation to check this would help the adoption rate of this library.
from firestoregoogleappsscript.
I went ahead and created a new Service account and downloaded a new key.
Did this have any impact on the issue? Nothing has changed for the past year or so in the repo, so I think this must be a configuration issue. Any idea what you might have messed up in Firebase?
from firestoregoogleappsscript.
Thanks for the response. I'll close this now because when I hard code the serviceEmail
, private_key
, and project_id
into my script it works fine. There must be some problem with Script Properties (even though they have the same 3 values.)
Any idea what you might have messed up in Firebase?
I accidentally deleted an Android app in the same project. I guess that wouldn't have any effect on this Google Apps Script.
from firestoregoogleappsscript.
Utilities.computeRsaSha256Signature
requires that the key
be a valid PEM string. That is, it should look like
-----BEGIN PRIVATE KEY-----
privatekeyhere
-----END PRIVATE KEY-----
There must be some problem with Script Properties
I think you're on the right track with this. It seems like the key
you're getting is not a PEM (and very possibly null/undefined).
from firestoregoogleappsscript.
![]()
I'm having the same issue although I can log the key fine. thinking
This is easily enough information to fully recover the private key - see this post for an example. I highly recommend changing the image to something else.
from firestoregoogleappsscript.
Related Issues (20)
- Is there anyway to update a nested field but leave other fields unchanged? HOT 1
- Unable to update nested fields with custome mask in updateDocument()
- getDocuments has SyntaxError: Unexpected end of JSON input HOT 3
- Apps script FirestoreApp when query 'collection1' where 'timestampField' == my_variable_Timestamp HOT 1
- Use the count() aggregation
- Queries using != and not-in
- Inserting Weird Values After Updating
- getDocuments() doesn't return the path of each document HOT 1
- Firestore feature missing HOT 1
- Prevent auto conversion to GeoPoint HOT 1
- How do I create a query which compares a value which is inside a map in the document? HOT 1
- README Properties Service key retrieval error HOT 4
- Subcollection being created upon updating Firestore collection HOT 2
- FieldValue support HOT 7
- FieldTransform Support
- "Bad Request" Issue when updating / querying document information HOT 2
- Poor performance when updating thousands of data HOT 8
- Make updateDocument mask default to true
- Accessing specific database HOT 1
- Add examples of unwrapping firebase data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firestoregoogleappsscript.