Note: This is not an officially supported Google product.
Write something.
License: Apache License 2.0
I get an error when trying to authorize my application to my gmail account to activate push notifications.
When clicking the link in the "Trigger" tab in the auth_init function -- choosing the email account - clicking past the unverified app page - allowing permissions -> then i get this message after confirmation of settings:
"An error has occurred in the authorization process."
Console in Chrome says:
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://appengine.google.com/_ah/loginform?state=~AJKiYcGSoGF9FIKAWtQzvyjvE_kEnQ_NbMCaCgc_BHxeTRx77TZZzzwPBWBLeh0tSJ76YwdLFYDTK4c-bdp2sq00DHo3cvS5eCe8yttlof_9F_DIrTRP0Ki9t98iM0tX1rQl6gJXEVbdIBjDFd21fs8WiUsEoJIngXwLEoaKkIm-Xy1Yxfq1pI4aGA-PL_R2rSWmAXapaNN6k3aIUmEmmjMBsJxMmg05VQDIN_D4TgIIuHlSwavLlCRtTREgOCoFCUpzja6_9AMz5sTrbicdzblRWJ4YeVdnpYbE8AbP9X76z48OWGkYgjQWFopnV7DpQl0r0MYC-XZjthMF-XgeaxzJnjIyhWlVQMrV60HvUnri6uFvEnNFJpgixlOkW0CDteWjdsmDeZ3w with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Auth callback shows an error:
TypeError: Cannot read property 'split' of undefined
at handler (/srv/node_modules/@google-cloud/express-oauth2-handlers/routes.js:50)
at (/srv/node_modules/@google-cloud/express-oauth2-handlers/routes.js:114)
at (/worker/worker.js:783)
at (/worker/worker.js:766)
at _combinedTickCallback (internal/process/next_tick.js:132)
at process._tickDomainCallback (next_tick.js:219)
I also tried running Chrome with --disable-web-security to try to disable CORB -- the error disappears frmo the console about CORB but the message in is the same.
Any ideas?
express-oauth2-handlers
module causes the DeprecationWarning: The 'refreshAccessToken' method has been deprecated
error.
Additionally the module has been abandoned and need to be replaced with an alternative solution.
Can't pass step 4. In the domain verification it asks me to verify ownership:
Verify ownership:
Before you register <project_url> you must first verify ownership. You can do this in the Google Search Console.
Another problem on this lab - probably related to the Node 8 change.
I can deploy the auth_init and auth_callback functions, despite getting a warning about Node 8 being deprecated.
Then, I was getting frustrated because I'd get a failure to deploy when trying to add the callback URL (as per the lab instructions, page 4). So I tried to redeploy with no changes at all. And that failed.
Lots of errors apparently related to secrets and needing GCP_PROJECT set. Since most back end I do is in GO, this is not stuff I know.
I can't get past the domain verification. I add the domain and google asks me to verify it. It takes to a verification page and asks me to upload a small HTML file to the site which I did, but it won't verify.
I was able to deploy the functions and add all the env_vars.yml and deploy a second time having completed the permissions grants. However, at step 5 "Setup Gmail push notifications" after clicking "Allow" I get the error: "An error has occurred in the authorization process".
GCP Logging is full of only one error, but this was present before I was able to get to the "Allow" step 5.
2021-11-04T18:08:05.121Zauth_callback Searching for secrets in: /workspace/node_modules/@google-cloud/client_secret.json
2021-11-04T18:08:05.122Zauth_callback Provided module can't be loaded.
2021-11-04T18:08:05.122Zauth_callback Is there a syntax error in your code?
2021-11-04T18:08:05.122Zauth_callback Detailed stack trace: Error: Missing required keys: GCP_PROJECT
2021-11-04T18:08:05.122Zauth_callback at exports.Provider.Provider.required (/workspace/node_modules/nconf/lib/nconf/provider.js:364:11)
2021-11-04T18:08:05.123Zauth_callback at Object.<anonymous> (/workspace/node_modules/@google-cloud/express-oauth2-handlers/config.js:53:7)
2021-11-04T18:08:05.123Zauth_callback at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-11-04T18:08:05.123Zauth_callback at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-11-04T18:08:05.123Zauth_callback at Module.load (internal/modules/cjs/loader.js:937:32)
2021-11-04T18:08:05.123Zauth_callback at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-11-04T18:08:05.123Zauth_callback at Module.require (internal/modules/cjs/loader.js:961:19)
2021-11-04T18:08:05.123Zauth_callback at require (internal/modules/cjs/helpers.js:92:18)
2021-11-04T18:08:05.123Zauth_callback at Object.<anonymous> (/workspace/node_modules/@google-cloud/express-oauth2-handlers/tokenStorage.js:17:16)
2021-11-04T18:08:05.123Zauth_callback at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-11-04T18:08:05.123Zauth_callback Could not load the function, shutting down.
Note the "Error: Missing required keys: GCP_PROJECT". I tried to set GCP_PROJECT in the env vars, but get an error that it is a protected env var. I renamed the value in index.js to _GCP_PROJECT and did the same for env vars, but the error persisted making me think it is in another lib.
A note to the authors, the URLs of auth_callback and the pubsub only differ by GCP project. Several steps could be saved by creating the values in the file at the beginning.
Thanks for this awesome codelab at first. It works fine with a single Gmail account. I tried to read the email from different email accounts for which i just used the URL which is available in auth_init.
Authorization was successful but when a new message comes in. I am getting an error like Delegation denied at GAxios for the primary email account.
But if i send an email from my primary account to the second one it reads the email and the task executed successfully.
May i know why the Delegation denied error is coming.
Hi,
I have tried to multiple users to subscribe to the topic in pub/sub but when the new user starts to compose the email whatever they type in gets updated to the google sheet automatically
On the Authorized Javascript origin it says that the URL should be like this:
https://us-central1-my-project.cloudfunctions.net/
but when you paste it the system correct and says that should be without the / on the end:
https://us-central1-my-project.cloudfunctions.net
I came across a random issue, I am testing this out with multiple gmail accounts.
A few months ago I had one of my gmail account connected up, the token had obviously expired, so I reauthorized access, that all worked as expected.
In the logs, I saw that the gmail.users.messages.list returned a message.id for a different gmail account I am also testing with, and I was able to confirm this by using this https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get against the other account.
This is my code, note that I modified it to be 'me', and looking in the logs, it eventually stops returning the wrong id but the problem is that the actual email that triggered the pub/sub is "skipped".
any ideas?
const getMostRecentMessageWithTag = async (email, historyId) => {
// Look up the most recent message.
console.log(`getMostRecentMessageWithTag email: ${email} `);
const listMessagesRes = await gmail.users.messages.list({
userId: 'me', // use 'me' instead of email
labelIds: ['INBOX'],
maxResults: 1,
includeSpamTrash: false
});
....
const message = await gmail.users.messages.get({
userId: 'me', // use 'me' instead of email
id: messageId
});
The codelab works very good, but since Datastore evolve into Firestore it would be great to update this lab to Firestore.
Hey guys!
Thanks for great tutorial it was really helpful to me and works well, except one moment... cloud function stops working after 3-4 days. Could someone tell me what could be the reason of this?
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.