-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google+ shutdown will break OAuth provider #6069
Comments
The scopes requested by default are:
It seems like it's just the last one which is connected with Google+. Is the fix as simple as removing this scope? I don't think the default auth flow even uses it? This would be a breaking change, but most common use cases are covered by the other scopes - and it's going to break anyway when Google+ is shut down. |
It's the call out to |
I expect you can simply replace the call to It should return a response comparable to the one returned by the deprecated + API and not require any further changes (aside from removing the https://developers.google.com/apis-explorer/#search/userinfo/m/oauth2/v2/oauth2.userinfo.v2.me.get Alternatively, you can skip that call if using their TokenInfo endpoint to handle token validation. If the email and profile scopes are included, it automatically returns those fields. |
Pardon my ignorance on the subject.... but where do I find this call in an asp.net web api project? I'm only using token validation. I know I'm using it somewhere, according to google I'm sending calls to plus.people.get I do have reference to Microsoft.Owin.Security.Google |
If you're using ASP.Net Core 2.2, you might have the following code in your Startup.cs file which makes use of the OAuth provider (taken from https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins?view=aspnetcore-2.2):
I'm currently using this and am affected by this issue. |
Definitely a breaking change on my site... I hope it's as simple as just updating Microsoft.Owin.Security.Google NuGet pkg when they are able to update it. |
Yup this will break our stuff. I tried changing the endpoints to the ones given back by the well-known configuration: The current code works until it tries to retrieve the userinfo. For users like us, we do not really need to poke the userinfo endpoint, the id_token already contains information about the user. I guess in some cases it may be easier to poke the user endpoint than to actually verify the id_token. I hope there is an answer soon from the owners of the project, Google has threaten to start failing requests as early as January 28,2019. |
cc @DamianEdwards @Eilon @davidfowl FYI. |
I confirmed that manually disabling the Google+ API in their developer console does indeed break the process. I tried enabling their People API hoping they may do some magic on their side to redirect the request but no luck there. According to their documentation, the People API allows for the profile, email, and some other related profile scopes: https://developers.google.com/people/v1/how-tos/authorizing#OAuth2Authorizing |
Workaround, all the user info has changed format so you need to remap everything:
[Edit 1/3/19]: Updated to use a different endpoint. This should work with ASP.NET Core 2.0 and later. Does anybody here have interest in 1.0 or 1.1? I'll follow up on the the Microsoft.Owin components. |
This does not work. |
Can confirm: I get the same error on my end. Using ASP.NET Core 2.1. |
@HaoK is Identity looking for the NameIdentifier claim? I wonder if sub is the same as the old Id claim. What if you add: Ah, yes, there it is. https://github.com/aspnet/Identity/blob/fcc02103aa10dcdd8759e0463cac2717114f3c1e/src/Identity/SignInManager.cs#L611 Edit: I updated my sample above. |
Adding |
Did it recognize you as the same user, or as a new user? |
Same user. I used two different accounts and both logged in correctly. |
Yeah we use the Name identifier to use as the key to associate logins in identity, and the email which we use as the user name |
Updates for Microsoft.Owin.Security.Google are being tracked at aspnet/AspNetKatana#251. I've posted a temporary workaround there. |
some of us are still using asp.net core 1.1 - interested if there is a simple work around for us as well. Thanks for the short notice google! |
@dwdickens the Microsoft.Owin example I posted here should easily adapt for Asp.Net Core 1.0 and 1.1. Let me know if it gives you any trouble. |
I can confirm it works in .Net 4.5.2 if you update Microsoft.Owin.Security.Google to version 4.0.0 |
This worked great. Just an FYI that given_name and family_name should be all lowercase otherwise it won't pull that information correctly. Thanks. |
@AnthonyMascia this one seemed more appropriate for an OAuth2 component, and it's also a later version of the API. The prior one was an OpenIdConnect specific endpoint and an older API version. |
@Tratcher Thanks for submitting the fix for this. I'll keep an eye on the pull request. #6338 and re-post a question in IdentityServer/IdentityServer4#2931 to see if the IdentityServer4 build will need to reference the new core update. |
* Update Google Auth UserInfo endpoint #6069 * Add Google to PatchConfig
@Tratcher Do you know what the ETA for the .NET Core release of this fix is (since the message from Google that you quoted says it will start being phased out from Monday next week)? Am I correct to assume that it's in the |
@lostllama see #6486. It's unclear what they meant by "intermittent failures", but in the worst case there are workarounds included in #6486 as well. |
Hi all,
From examining Google Console Platform, there are "OAuth consent screen" tab on project's credentials page. Three scopes are listed: email, profile, openid. If you hover over an "openid", the following URL can be seen: https://www.googleapis.com/auth/plus.me. The following code can be added to Startup.cs file:
These "plus.me" scope disappears in request body afterwards. This scope doesn't seem to be needed as email & profile scopes cover data that "plus.me" does. Hope it helps. |
@funkysoulbro I was just wondering if we should remove the openid scope. In the Google documentation it is said:
So to me, it looks like it is a mandatory scope for being able to authenticate a user. |
Their scope docs for Google Sign-in also list profile, email, and openid. I recommend leaving openid enabled until we can confirm if it causes any functional problems. |
@Tratcher I hope you can report back and tell us what to do because I feel like my sites are about to break 😒 I am running some older .NET MVC sites, so I implemented the hotfix (that seems to be working because in te Google administration panel it is not registering any hits on the Google+ API) |
I found this official migration guide that says |
|
are we able to fix this by updating the Microsoft.Owin.Security.Google from 4.0.0 to 4.0.1? please advice. Thank you |
Yes. |
Hi All, I'm sure most of you have received an email from Google announcing the deprecation of Google+ APIs. From March 7th, 2019 OAuth requests to this authentication API will be shutdown completely. As per the following documentation snippet from Google changing scopes should be enough to continue beyond the deprecation date without any further issue.  Any help will be appreciated as there's currently no useful information on the web. |
@Tratcher are these New scopes with their respective URLs enough, please?
|
Yes, see #6069 (comment) |
Thanks @Tratcher 👍 👍 |
The Authentication.Google package implements OAuth2 with Google services. However, it uses Google+ to fetch additional user information.
https://github.com/aspnet/AspNetCore/blob/5ab3c89be3e6342f2a39c666fd0aca708fc7ec8b/src/Security/Authentication/Google/src/GoogleDefaults.cs#L21
https://github.com/aspnet/AspNetCore/blob/5ab3c89be3e6342f2a39c666fd0aca708fc7ec8b/src/Security/Authentication/Google/src/GoogleOptions.cs#L29-L34
"The Google+ Sign-in feature is fully deprecated and is being shut down on March 7, 2019. This will be a progressive shutdown, with intermittent failures starting as early as January 28, 2019. Developers should migrate to the more comprehensive Google Sign-in authentication system." ~https://developers.google.com/+/web/signin/
This is a patch candidate all the way down to 1.0 and Katana. @muratg @blowdart
Proposals:
The text was updated successfully, but these errors were encountered: