Google API is active but give error ; Legacy People API has not been used in project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
-
The request requires your Google Account number, otherwise, the connection will fail. – jdweng Oct 31 '19 at 14:52
-
I ran your id with code form following and it say key invalid : https://stackoverflow.com/questions/34597229/google-maps-api-for-c-sharp – jdweng Oct 31 '19 at 15:29
-
why ? but Client ID is true – Ömer ARGIN Oct 31 '19 at 15:40
-
I'm just reporting what the response string says. The connection is being accepted by the server since you get a 200 OK in the response. You are just not getting the results of the query because the ID is not valid. – jdweng Oct 31 '19 at 15:49
-
i don't understand. Client ID is true and Client secret is true.thanks – Ömer ARGIN Oct 31 '19 at 16:04
-
I know nothing about the API. The API may just be reporting that the connection is good without verifying the ID is good. I just know when I do not use the API and connect directly to google I get an invalid ID. – jdweng Oct 31 '19 at 16:21
-
2I have exactly the same error, it started from last week. Have you found a way to fixed that? I feel that something went wrong on Google's side with my ClientId record... Maybe they were working on something and we got the "side-effect"? – Axel186 Nov 05 '19 at 11:24
-
Did anyone get a solution? – Mohit Rane Nov 14 '19 at 09:19
-
December 2019, error continues! As **Ilan Laloum** solution must be use people api instead plus api :s. – JRichardsz Dec 03 '19 at 16:08
-
2Did anyone manage to find a solution to this error? I'm just trying to implement Google Sign-in and the error still occurs Jan 2020. Anyone? – regan Jan 06 '20 at 17:45
-
Still error 2020. – Binh Ho Mar 17 '20 at 01:18
8 Answers
You don't need to install any other APIs like Google Drive API, Google Sheets API or other except Google+ API,
The error is coming because of "passport-google-oauth": "^1.0.0"
Just change the version "passport-google-oauth": "^1.0.0" to "passport-google-oauth": "^2.0.0" and remove node_modules and package.lock.json file and run "npm i"
That's it

- 385
- 3
- 3
-
2you rock! Thank you! I was actually using `passport-google-oauth20@1.0.0`, so I removed it and installed the `2.0` version after reading your answer and it worked. – Daniel Feb 16 '20 at 02:41
-
how do I do this pls? Can you provide some more info like some commands or where to look for it? – alex toader Aug 16 '20 at 09:40
-
Before the Google+ API Shutdown on March 7, 2019, the people.get and people.getOpenIdConnect methods were available for requesting a person’s profile.
To avoid breaking existing integrations with these methods supporting sign-in, a new minimal implementation only returns basic fields necessary for that functionality, such as name and email address, if authorized by the user. The Legacy People API is where these methods will remain available for existing callers at the existing HTTP endpoints.
The Legacy People API serves a limited new implementation of the legacy Google+ API people.get and people.getOpenIdConnect methods necessary for maintaining sign-in functionality. It is available to existing callers of the original methods that haven't migrated to recommended replacements such as Google Sign-in or Google People API at the time of the Google+ API shutdown.
Thanks

- 59
- 5
In this case, I'm facing the same issue. This is what I've done to fix it.
Situation:
- NodeJS ver 8
- "passport-google-oauth": "^1.0.0"
- Using Google+ API as Google Sign-in
When I run the apps and click Sign in with Google, what happened then?
- Server error
- Error log: Legacy People API has not been used in project "xxxx" before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=xxxx then retry.
How I solve it?
- Go to Google Console
- Click on Google+ API under Social APIs, then click Enable API
- Click on Google Drive API under G Suite, then click Enable API
- Click on Google Sheets API under G Suite, then click Enable API
- Update "passport-google-oauth": "^1.0.0" to "passport-google-oauth": "^2.0.0" in package.json
- remove package-lock.json and node_modules folder (to ensure everything is clear)
- run this command : npm install
- It works now!
Note: my previous code still using profile._json.image.url to get profile image. Actually, this response was not there anymore. So I delete this code. Goodbye Google+ Thank you Google People API.

- 253
- 1
- 4
- 20
-
This gives me an error: `There was an error while loading /apis/api/legacypeople.googleapis.com/overview?project=xxxx. Please try again.` – Jim.B Mar 17 '20 at 09:11
-
Enabling the Google Contacts API and the Google+ API fixed this issue for me.

- 1
-
Hi, this action must have been valid by the time you did it. As of now (2020) Google+ API has been completely decommissionned for new projects. – avi.elkharrat Jan 13 '20 at 13:16
Hi I recently stumbeled on the same issue. As explained by Ilan Laloum, Google+ API as been decommissionned completely for new projects.
I found that Google People API works in a similar way. The following example is based on the Bookshelf tutorial in GCP. Source code can be seen here: https://github.com/GoogleCloudPlatform/golang-samples/tree/appengine/go111/cloudsql/getting-started/bookshelf (branch appengine/go111/cloudsql
)
import people "google.golang.org/api/people/v1"
...
// retrieves the profile of the user associated with the provided OAuth token
func fetchProfile(ctx context.Context, tok *oauth2.Token) (*people.Person, error) {
peopleService, err := people.NewService(ctx, option.WithTokenSource(bookshelf.OAuthConfig.TokenSource(ctx, tok)))
if err != nil {
return nil, err
}
return peopleService.People.Get("people/me").
PersonFields("names,coverPhotos,emailAddresses").
Do()
}
This method needs a context and a OAuth token, just like Google+ API used to. The peopleService
is initialized in a similar fashion.
The peopleService.People.Get("people/me")
prepares a query that fetches the profile of the connected user. Then PersonFields("names,coverPhotos,emailAddresses")
is a filter on profile fields. This part of the request is mandatory. Eventually Do()
will execute the request.

- 6,100
- 6
- 41
- 47
This issue can be fixed using the passport-google-token
npm install passport-google-token
const GoogleStrategy = require('passport-google-token').Strategy;
// Google OAuth Strategy
passport.use('googleToken', new GoogleStrategy({
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET
}, async (accessToken, refreshToken, profile, done) => {
try {
console.log('creating a new user')
const newUser = new User({
google: {
id: profile.id,
email: profile.emails[0].value
}
});
await newUser.save();
done(null, newUser);
} catch (error) {
done(error, false, error.message);
}
}));

- 705
- 8
- 19
I was also having the same issue but with my Rails app. So I resolved it by upgrading the omniauth gems by running bundle update devise omniauth omniauth-google-oauth2
in terminal.

- 183
- 2
- 12
I also faced the same issue. This issue may occur for using the old library, enable the google people Api for your project, and download the library as per your php version from this link and integrate it.

- 4,704
- 13
- 34
- 52

- 11
- 1