-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[google_sign_in] Fix issue obtaining serverAuthCode on Android and add forceCodeForRefreshToken parameter #3356
[google_sign_in] Fix issue obtaining serverAuthCode on Android and add forceCodeForRefreshToken parameter #3356
Conversation
Thanks for the submission! We’re currently working through a large backlog of PRs, and this will require non-trivial review, so it will take some time before we’re able to review it. As explained in CONTRIBUTING.md, votes for the corresponding issue are the primary way we’re prioritizing non-trivial reviews, so we encourage anyone interested in this PR to vote for the corresponding issue. We apologize for the long delay in triaging this PR. We’re in the process of overhauling our PR triage system to respond much more quickly, as well as working through the backlog. (Note that #2792 is making a similar change, so when they are reviewed we should ensure we converge on a single PR that addresses everything.) |
Unfortunately our push toward better testing coverage occasionally misses things, leading to inconsistencies like that. As evidenced by the need for this PR, that one really shouldn't have landed either without e2e testing! |
This problem is very relevant, and it is around for a long time. A huge part of Google's Api depends on server side authentication. I am currently trying some workaround to implement his changes on my installation, but I'm getting an error "google_sign_in_platform_interface ^1.2.0 which doesn't match any versions, google_sign_in from git is forbidden." If I can, I'll use it before it's merged into master |
I updated the code to work with the current master. It's working fine for me. But it would be better if this PR was updated instead. I'm not very experienced making PR to large projects. But I made it available since it might be useful to someone who needs this specific task or in case this is not being updated. If necessary, I'll fix the issues. |
a09c3f5
to
e3aea13
Compare
@dreenot It looks like basically what was needed was updating the version numbers and adding some nullable types, right? I updated this PR accordingly...I think your PR was missing the updated implementations of @stuartmorgan No problem! I was just a bit frustrated at the time and about to embark on a saga of a PR to add scribble support (which is still in progress, actually) |
BTW here is a patch that makes the analyze work properly:
|
@fbcouch I noticed another problem that I'm afraid we can't fix here. Yes, we are able to get the I consulted the documentation all the way down to Google Play Services, it SHOULD be setting it to offline when you use
|
@dreenot Oh that is very interesting...what version of google play services are you using? I am able to get valid serverAuthCodes on com.google.gms:google-services:4.3.0 (I think that would be the relevant library, not 100% sure of that though) |
@fbcouch It happens I had an |
I believe the first of the two bullet points in the PR description was obsoleted by #4180 For the second part, can you explain why this is something configured for the entire app via an XML property, rather than being part of the API surface? |
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Yes, it looks like at least the serverAuthCode part is handled already now, so we just need the forceCodeForRefreshToken stuff. I think I had done it through the XML because that's the way most of the android options are defined. Adding it to the API surface sounds better to me. I'll see if I can make some time in the next couple of weeks to update this to target the latest |
…low android to receive a refresh token on every sign in
0f984ea
to
b73d66e
Compare
Formatting issue:
|
Sorry, I lost track of the state of this PR. The next step here would be to split the implementation package parts into a new PR. While from a compilation standpoint this would be landable as-is, we don't want to add a new app-facing parameter that doesn't actually work (if someone updates only the app-facing package, which happens more than you might think). So generally we land the implementations, and then the final PR for the app-facing package updates the minimum version of the implementation packages (in this case we only need to rev Android) so that when someone gets the new API they will definitely also get a working implementation of it. |
Sorry, I haven't had a chance to come back to this in awhile – so you are saying I should separate the |
…-implementations] Revert unnecessary changes to google_sign_in_web
All right assuming that is correct, the platform implementations are here: #6130 |
Yes, that's correct; once the implementation lands, then there will be published versions you can use as the new minimum constraints in the app-facing package. |
The platform interface changes have landed and been published, so the implementation parts can now be split out into a new PR. |
…ished versions; update google_sign_in changes / changelog / pubspec depenencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I got confused about the state and thought this was still waiting on the implementation package PR, and didn't realized it had already been updated since they were landed and published.
LGTM, and sorry this was waiting unnecessarily!
…oid and add forceCodeForRefreshToken parameter (flutter/plugins#3356)
…d forceCodeForRefreshToken parameter (flutter#3356)
…d forceCodeForRefreshToken parameter (flutter#3356)
Description
This is a follow up to #2116 to fix the following issues:
serverAuthCode
is always null on Android because it is not passed to theGoogleSignInAuthentication
object as that is created by thegetTokens
call rather than from the data obtained during the initialsignIn
call (which does contain aserverAuthCode
, it's just not accessible anywhere that I can tell)Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.A note on
flutter analyze
: this plugin updatesgoogle_sign_in
andgoogle_sign_in_platform_interface
, soflutter analyze
won't pass until thegoogle_sign_in_platform_interface
update is published or an additional commit is applied that sets up local path dependencies (see fbcouch@3bbdfec ). I can split that into two pull requests if needed.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
Festivus NoteAs the season of Festivus is upon us, I do have a grievance to air from the last time I submitted a PR related to this plugin. I was told on #879 that my pull request to add the serverAuthCode (which worked on android, as a side note) would not be accepted without E2E tests using a test harness that wasn't even ready yet. You can imagine my surprise when #2116 was merged a few months later without them (no disrespect to the author of that PR, they did what was asked of them).