2

I've got project, where I have to login through google sign in. I have created google project. Set up client/secret keys. I got to the point where I'm making post request to my web app server and sending there the accessToken:

OAuth2ConnectionFactory<Google> connectionFactory = (OAuth2ConnectionFactory<Google>) connectionFactoryLocator().getConnectionFactory(Google.class);
AccessGrant accessGrant = new AccessGrant(accessToken);
Connection<Google> connection = connectionFactory.createConnection(accessGrant);

The request is: GET https://www.googleapis.com/plus/v1/people/me Accept: application/json, application/*+json Authorization: Bearer etc.

Here I got exception: 403 Forbidden. I had to manually track what the actual request is done and made rest request manually to replicate the issue with given headers.

Here is the result I'm getting:

"code": 403, "message": "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."

First of all the link fails to load. I didn't find any "Legacy People API". Only new People API.

I wonder if there is any solution to this problem? I have enabled People API and waited for long enough but the same error remains.

EDIT 1: I think the project spring-social is dead. Will rewrite login logic and kick spring-social out of it..

maximus
  • 4,201
  • 15
  • 64
  • 117
  • Hey! Same story here... The feature stopped working at the end of October. As a temporary solution, I created another project in Google Console with absolutely the same approach (APIs and etc). It works, but I would like to use the original project. Anyway, still looking for solution. – Axel186 Nov 05 '19 at 12:50

2 Answers2

0

ME TOO . this my problem. I'm waiting 6 hours

"code": 403, "message": "Legacy People API has not been used in project

Ömer ARGIN
  • 231
  • 1
  • 2
  • 4
  • I have recently found out that the spring social project is dead. Not sure if you are also using it. Will have to rewrite the login logic without it. – maximus Nov 01 '19 at 13:46
0

Try using the Google Identity Platform OAuth API instead of the Legacy People API.

John
  • 1
  • Ok just found out that spring-social is not supported anymore. Dead. – maximus Nov 01 '19 at 14:06
  • Facing the same issue. Which is the replacement library for the spring-social. What are the changes do we need to make? – Krishna Shetty Nov 12 '19 at 06:22
  • @KrishnaShetty, I think it is now inside spring-security latest version. I will have to refactor the code for login.. Or it could be made independent on spring, but using provided by google/and other social networks api. – maximus Nov 28 '19 at 12:42