Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a new project on Google Console, Get the Credentials but the init process never ends #127

Open
rgrlaika opened this issue Feb 7, 2023 · 21 comments

Comments

@rgrlaika
Copy link

rgrlaika commented Feb 7, 2023

I noticed that google apis deprecated the Out-Of-Band (OOB) which means that credentials created now does not have the urn:ietf:wg:oauth:2.0:oob it creates with "redirect_uris":["http://localhost/"]}}

Then I was trying to run the node node_modules/gmail-tester/init.js cypress/events/gmail/credentials.json cypress/events/gmail/gmail_token.json <[email protected]>

Note: the actual email has been omitted

Then it directly opened the page to grant the email and redirected to the : localhost asking to back to the terminal

Screenshot 2023-02-07 at 15 42 44

I back to the terminal but what I had was the prompt below forever:

[gmail] Checking for message from '', to: [email protected], contains '' in subject...
Note: I never asks me to put a code in the terminal

I think it has something to do with the deprecation of Out-Of-Band (OOB)
https://developers.google.com/identity/protocols/oauth2/resources/oob-migration

I tried to use the latest version of gmail-tester and it does not work.

Indeed it creates the file gmail_token.json (in my case) but if I delete it, when running the tests it opens a new instance of the browser during the cypress test execution, and asks to grant the permission for the email again, hence a manual intervention needed.

Any idea if it's a known issue if it's a workaround?

I also noticed people complaining it here without any answers:

#73

@hieuTranEnouvo
Copy link

I still get the issue above
error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"errors": [
{
"message": "Login Required.",
"domain": "global",
"reason": "required",
"location": "Authorization",
"locationType": "header"
}
],
"status": "UNAUTHENTICATED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "CREDENTIALS_MISSING",
"domain": "googleapis.com",
"metadata": {
"method": "caribou.api.proto.MailboxService.GetMessage",
"service": "gmail.googleapis.com"
}
}
]
}

@azadnsu
Copy link

azadnsu commented Mar 8, 2023

@hieuTranEnouvo For me, it works all good. Have you placed credentials.json correctly in the path you are pointing?

I tried gmail-tester v1.3.8 , yes it does not ask to enter code now but this is more better. You don't need to enter code now, it automatically gets authenticated!
Screenshot 2023-03-08 at 19 11 09

@NighatAtta
Copy link

NighatAtta commented Mar 10, 2023

@azadnsu I am facing the same issue as above. In my case it is giving me the following error:
FetchError: request to https://gmail.googleapis.com/gmail/v1/users/me/messages/181dc6b25056f876?format=full failed, reason: connect ETIMEDOUT 216.58.209.138:443
Do you have any idea about this? Any help would be appreciated.
2023-03-10 (4)

@hieuTranEnouvo
Copy link

@azadnsu The issue still display. It doesn't enter code automatically
Screenshot 2023-03-10 at 14 42 51

@azadnsu
Copy link

azadnsu commented Mar 10, 2023

@hieuTranEnouvo See your account is actually set up successfully, otherwise, it won't go for email search.
Now, regarding the error, your Gmail account might have a quota per minute set to 0. Please try to increase it.
Here are some resources about how to do it:
https://stackoverflow.com/questions/66785834/quota-exceeded-for-quota-metric-requests-and-limit-requests-per-minute-of-se

Please check what its Request per minute in Quotas in your project Admin in Google cloud something like here: https://console.cloud.google.com/iam-admin/quotas

@hieuTranEnouvo
Copy link

@azadnsu Thank you for replying
I can't find a quota per minute set to increase it.

Screenshot 2023-03-10 at 15 17 12

@azadnsu
Copy link

azadnsu commented Mar 10, 2023

@hieuTranEnouvo Go to the next pages, Request per minute is there.

@azadnsu
Copy link

azadnsu commented Mar 10, 2023

@hieuTranEnouvo You can increase quotas from there Or follow this solution posted in another thread: #78

@hieuTranEnouvo
Copy link

@azadnsu here what I found
Screenshot 2023-03-10 at 15 44 14
But I still don't know what the issue is

@azadnsu
Copy link

azadnsu commented Mar 10, 2023

@hieuTranEnouvo I have no idea as well, your account got connected. Its Gmail API blocking requests which you need to figure out!

@hieuTranEnouvo
Copy link

OK thank @azadnsu

@azadnsu
Copy link

azadnsu commented Mar 13, 2023

@hieuTranEnouvo Could you please try with a fresh Gmail account from the scratch. Just to give a try!

@hieuTranEnouvo
Copy link

@azadnsu let me check now

@hieuTranEnouvo
Copy link

hieuTranEnouvo commented Mar 13, 2023

Screenshot 2023-03-13 at 15 10 36
@azadnsu I used another account but still get the issue

@hieuTranEnouvo
Copy link

hieuTranEnouvo commented Mar 13, 2023

View or change usage limits, increase quota
To view or change usage limits for your project, or to request an increase to your quota, do the following:

1/If you don't already have a billing account for your project, then create one.
2/Visit the Enabled APIs page of the API library in the API Console, and select an API from the list.
3/To view and change quota-related settings, select Quotas. To view usage statistics, select Usage.

==> I don't know how to "To view usage statistics, select Usage"
pls help me that @azadnsu

@azadnsu
Copy link

azadnsu commented Mar 13, 2023

There should be no quota problem in a normal gmail account. Looks like somehow your account is connected to business account!

@hieuTranEnouvo
Copy link

hieuTranEnouvo commented Mar 13, 2023

@azadnsu I have 3 accounts which are connected to business account?
It is same the error for 3 accs

@dev101
Copy link

dev101 commented Mar 16, 2023

If your mailbox contains 1000s of emails, I guess you just need to limit the result set by using some filtering options like after.

@owenbendavies
Copy link

Did anyone solve or update this for the OOB deprecation?

Error 400: invalid_request
The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method.
Request details: redirect_uri=urn:ietf:wg:oauth:2.0:oob

Our cypress tests just started failing, and I suspect it is due the the token expiring and we can't generate a new one due to this being deprecated by google

https://developers.google.com/identity/protocols/oauth2/resources/oob-migration

@neoanantha
Copy link

Solution @ #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants