Google OAUTH issue
See original GitHub issueHello Davido,
Im running Gerrit 2.16.8 fully migrated to noteDB. Im still using gerrit-oauth-provider version 2.13.2 and all is fine. I was planning to upgrade the plugin but im having problems. Same as issue 123 This is what i have in gerrit.config:
[plugin "gerrit-oauth-provider-google-oauth"]
client-id = *****************************
fix-legacy-user-id = true
link-to-existing-openid-accounts = true
If i try to use the latest version of the plugin i get this error while authenticating then a redirect to a forbidden page
[2019-05-21 23:09:27,787] [HTTP-185] WARN com.googlesource.gerrit.plugins.oauth.GoogleOAuthService : The support for: link-to-existing-openid-accounts is disconinued
[2019-05-21 23:09:30,529] [HTTP-186] INFO com.google.gerrit.httpd.auth.oauth.OAuthSession : OAuth2: linking claimed identity to 1601
[2019-05-21 23:09:30,608] [HTTP-186] WARN com.google.gerrit.server.account.AccountManager : Email *@gmail.com is already assigned to account 1601; cannot create external ID google-oauth:109031793006731947128 with the same email for account 1601.
[2019-05-21 23:09:30,608] [HTTP-186] ERROR com.google.gerrit.httpd.auth.oauth.OAuthSession : Unable to authenticate user "com.google.gerrit.extensions.auth.oauth.OAuthUserInfo@1c548b0a"
com.google.gerrit.server.account.AccountException: Email '*@gmail.com' in use by another account
[2019-05-21 23:10:55,719] [HTTP-187] WARN org.eclipse.jetty.server.HttpChannel : /oauth
org.scribe.exceptions.OAuthException: Cannot extract an access token. Response was: {
"error": "invalid_grant",
"error_description": "Bad Request"
}
[2019-05-21 23:10:55,720] [HTTP-187] ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in GET /oauth?state=Miv5JCkWlMsF04EJ8017-fKK9rWDBGlAUvQs0YsXqN8&code=4/UgFvJ0GMZEOkUtzk0LYnZN3Eg_7YfmJZIzZz0UEBx2sDrEW0k5b07_daBFypG8G2I2YF0BWbhnqQbIkLCA4lyYo&scope=email+profile+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile
org.scribe.exceptions.OAuthException: Cannot extract an access token. Response was: {
"error": "invalid_grant",
"error_description": "Bad Request"
}
Here the details for the same account retrived from api GET /accounts/1601/external.ids
)]}'
[
{
"identity": "109031793006731947128",
"email_address": "*@gmail.com",
"trusted": true,
"can_delete": true
},
{
"identity": "google-oauth:109031793006731947128",
"trusted": true,
"can_delete": true
},
{
"identity": "username:Mich",
"trusted": true
}
]
Thanks in advance for help
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Authorization Errors | Device Access
During the authorization process, Google OAuth may return an error. Use this guide to troubleshoot the most common errors during this ...
Read more >Google OAuth
We are currently experiencing an issue with authentication to Google App Engine sites, the Google Cloud Console, Identity Aware Proxy, ...
Read more >Google oAUTH scope error [158278184] - Visible to Public
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup, without external dependencies. from __future__...
Read more >OAuth API verification FAQs - Google Cloud Platform ...
All apps that access Google APIs must verify that they accurately represent their identity and intent as specified by Google's API Services User ......
Read more >Google OAuth 2.0 failing with Error 400: invalid_request for ...
I was able to reproduce the same problem in a dev domain. I have three client ids. The oldest one is from January...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks Jmennius for the script, I extended it somewhat:
This allows running it with a third argument to help separate google and github ID:
assigns the right prefix to each ID. It also registers the renames with git.
The problem was fixed in Gerrit: [1].
[1] https://gerrit-review.googlesource.com/c/gerrit/+/238833