Google Plus API Shutdown Today, Which Alternative Can Be Used to Authentication

Google plus API shutdown today, which alternative can be used to authentication?

Finally, I somehow managed to solve the issue by providing an alternate OpenIdConnect endpoint for user information. Using source, I replaced:

https://www.googleapis.com/plus/v1/people/me/openIdConnect

with:

https://www.googleapis.com/oauth2/v3/userinfo

I monkey-patched omniauth-google-oauth2 as follows:

config/initializers/omniauth_google_oauth2_patch.rb

class OmniAuth::Strategies::GoogleOauth2 < OmniAuth::Strategies::OAuth2
def raw_info
@raw_info ||= access_token.get('https://www.googleapis.com/oauth2/v3/userinfo').parsed
end
end

And it's working great now.

Will tokens with Google plus scope invalidate after API shutdown

As long as the refresh token has other valid scopes, they will continue to work. Essentially, the plus.me scope will be "removed" from the token.

Google plus API shutdown, How it will affect Google auth2 login for web sites?

There is good news and bad news.

The good news is that you're not using any of the plus scopes.

The bad news is that you're using the plus API, which is also being shut down, and which was mentioned in a previous email that should have been sent to you.

Specifically, this chunk of code:

gapi.client.request({ path: 'https://www.googleapis.com/plus/v1/people/me' }).then(

calls the "plus.people.me" API.

Fortunately, you should be able to switch to a different API, such as the "userinfo" API, by changing endpoints to

https://www.googleapis.com/oauth2/v2/userinfo

You may also wish to look into the more modern People API, which works very similarly, and is slightly more complicated, but can provide other profile fields.

Do I have to replace the Google+ API

Google is going to shut down Google+ in some time so you wont be able to use Google+ APIs anymore. I dont think you can do much about it. You can remove support of Google+ from you application.

Here is the link - https://www.theverge.com/2018/12/10/18134541/google-plus-privacy-api-data-leak-developers

As per my understanding, you can still use passport-google-oauth2 for google authentication since this is associated with google account not with google+ account.

Your google+ APIs will not work anymore. You can get that information here - https://developers.google.com/+/api-shutdown

Now about your question regarding using passport.js, you should be able to use passport.js but you will not be able to call only google+ APIs. You can use all the other google APIs from using passport.js

Google plus API is shutdown. What to do in ionic 3 app?

I've been told (secondhand) that although the plugin is named google-plus, it no longer uses the Google Plus APIs.

Google plus API depreciation

Looking at this line in the code, it is making its call directly to Google's OAuth endpoint, and then later making a call to Google's userinfo v2 endpoint. In neither place does it use a plus scope nor a plus API (although its claim that it's asking for "ALL" scopes looks wrong).

The Google+ API and Scope shutdown does not appear to be a problem in your case.

Deprecation of https://www.googleapis.com/plus/v1/people/me and how properly to migrate

The "/oauth2/v3/userinfo" call will not be deprecated on March 7th, 2019 as it is not part of the Google + API.

If you look at the Google Developers Console, those calls are not registered as part of the Google + API.

From Google email:

If you are directly requesting the “plus.me” scope, any other Google+
OAuth scopes, or making any Google+ API calls, please ensure that you
remove these requests from your project before March 7, 2019.

How to get user email from google plus oauth

Set your scopes to:

  • https://www.googleapis.com/auth/userinfo.email and
  • https://www.googleapis.com/auth/userinfo.profile

And use the endpoint:

https://www.googleapis.com/oauth2/v1/userinfo?alt=json

Usage:

get https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=youraccess_token

You will get JSON:

{ "id": "xx", 
"name": "xx",
"given_name": "xx",
"family_name": "xx",
"link": "xx",
"picture": "xx",
"gender": "xx",
"locale": "xx"
}


Related Topics



Leave a reply



Submit