google-wallet / pass-converter

Tool to convert passes for different wallet apps from one format to another
Apache License 2.0
206 stars 29 forks source link

Conversion not starting when googleStorageBucket is set #17

Closed dominikponniah closed 9 months ago

dominikponniah commented 1 year ago

Everything works quite fine, but when I do want to convert a *.pkpass-File (it is a Season-Ticket including a Photo and a Logo) the error message is always the same:

Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.

If the googleStorageBucket-Value is not set, the Pass gets generated and could be added to Google Wallet.

Any ideas on how I could make it work? googleServiceAccountJsonPath and googleIssuerId is set correctly.

stephenmcd commented 1 year ago

Not entirely certain but it might help if you create a seperate script that saves a file to Google Cloud using the credentials/bucket you've configured - I imagine you'll get the same errors and if you can get that working, you'll solve the larger issue.

mousey commented 1 year ago

It's to do with the request to STORAGE.

I added a config item for the Google Project ID to the config.json

`// Google Cloud project id

"googleProjectId": "",`

And then amended app.js to account for the new way of authenticating

`// Create a Cloud Storage client

const storage = new Storage({projectId: config.googleProjectId, keyFilename: config.googleServiceAccountJsonPath });`

And that fixed the issue for me

stephenmcd commented 9 months ago

I suspect this arises when separate cloud projects are used. I'll close for now.