Comments (1)
I actually already resolved this problem, but wanted to document it here for future devs. The following solution was derived from the answers in this stack overflow thread
It is important to understand that this error is actually being thrown by Google Cloud Datastore, and not by any OAuth related service. In order to resolve it, you must ensure that the permissions of the account running your Google Cloud Function include the scopes necessary to access Google Cloud Datastore. Follow these steps:
- Determine the service account responsible for calling your Google Cloud Function.
- Navigate to your function in the Google Cloud Console and click Edit.
- Expand Runtime, build, connections, and security settings.
- You will see a subsection called Runtime service account. Expand the dropdown and make note of the selected id written beneath the account title. If you haven't changed it, it is likely that it will be the App Engine default service account whose id looks like [email protected].
- Add the necessary permissions to your project IAM.
- In the Google Cloud Console left panel, navigate to IAM & Admin > IAM (Important: do not go to the Service Accounts, tab).
- Locate the service account from step one in the table and click the pencil icon on the far right to edit that row.
- Some developers report that the service account does not appear in the table. In this case, you can safely add the the service account to your IAM.
- Click Add and use the id from step one as the new principal.
- Select the roles from the next step and click Save.
- Some developers report that the service account does not appear in the table. In this case, you can safely add the the service account to your IAM.
- You must ensure that this account has the following roles:
- Editor (I thought this was surely an over assignment of permissions but I can't get the function to work without it.)
- Cloud Datastore Owner
- Storage Admin
- Click Save.
- Redeploy your Google Cloud Functions.
If you follow the above steps, your issue should be resolved.
Note: Some developers have reported that after following these steps their functions continued to fail until they were deleted from the Google Cloud Functions console and redeployed.
from express-oauth2-handlers.
Related Issues (7)
- [google-auth-library:DEP007] DeprecationWarning: The `refreshAccessToken` method has been deprecated HOT 3
- Environment Variable Change in NodeJS 10+ Runtime HOT 2
- 'client_secret.json' is not found HOT 1
- Publish type declarations for Typescript HOT 1
- Agree and Continue button
- @google-cloud/express-oauth2-handlers not detecting required keys from client_secret.json HOT 1
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 express-oauth2-handlers.