The answer is in your error log, Activate the Google API in developers settings in your account.
Google-Oauth authentication error
-
07-07-2023 - |
Question
Getting the following error when trying to login with google -oauth.
I, [2014-04-23T10:08:24.349056 #4905] INFO -- omniauth: (google_oauth2) Request phase initiated.
I, [2014-04-23T10:08:24.861288 #4905] INFO -- omniauth: (google_oauth2) Request phase initiated.
I, [2014-04-23T10:08:28.637438 #4905] INFO -- omniauth: (google_oauth2) Callback phase initiated.
E, [2014-04-23T10:08:30.207714 #4905] ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, {"errors"=>[{"domain"=>"usageLimits", "reason"=>"accessNotConfigured", "message"=>"Access Not Configured. Please use Google Developers Console to activate the API for your project."}], "code"=>403, "message"=>"Access Not Configured. Please use Google Developers Console to activate the API for your project."}:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
Solution
OTHER TIPS
I found this question after some googling, and I was not very satisfied with @Babar's answer, as it id not actually resolve my problem.
After a lot of digging around I found that you have to enable the Google+ API
(some also say you need the Contacts API
) in your developer console. I did not have to do this before, but apparently some change has come around.
To do so, do the following steps:
- Go to https://console.developers.google.com/project
- Select your project
- Press "APIs & auth" from the side-panel
- Press "APIs" from the dropdown
- Find and enable
Google+ API
andContacts API
- After they are enabled,
WAIT ABOUT 5 MINUTES
for the APIs to kick in.
Now you should be able to use the Oauth2 login again.
I was also having a similar issue with my Rails app throwing error 403. So I resolved it by upgrading the omniauth gems by running bundle update devise omniauth omniauth-google-oauth2
in the terminal.