-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Google Sign In 4.5.1 - ServerAuthCode returns null value #57712
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
Comments
Code Sample
flutter doctor -v
|
@Faiyyaz you can pull these changes,it works for me now. flutter/plugins#2792 |
@zeeshanhussain i don't want to pull any outside commit bcoz even i have one of my commit and a commit of another user with me which works but i want to use official plugin bcoz if they make any updation in future then we need to implement in our commit as well so its better to wait and get this issue solved in official repo itself. |
@zeeshanhussain I pulled your code but still get null for |
@scaraux my changes were only for android, you can pull this for iOs flutter/plugins#2788 |
As you can see here: Web has never had this feature (although it seems it may be implemented, if you can request offline access after authenticating). I have revived #62474 to track progress of the web implementation only (this seems like a catch-all issue), if anybody wants to tackle it ASAP. I've assigned the "new feature" labels there as well, and removed "platform-web" from here. |
Is there any work around for getting serverAuthCode on android/iOS?? |
You can pick these pull requests |
I merged the changes from the 2 PRs into one so that it's easier to use. You can just add google_sign_in your project like
And add a dependacy override for google_sign_in_platform_interface
To get this to work in for iOS, you have to add a new key in your GoogleService-Info.plist file
You can find it in your firebase project settings or you can just check your google-services.json file This has been tested on both Android and iOS to obtain the serverAuthCode. Hope this helps until the current PRs are merged NOTE:- This is a current fork of the plugins in their current state and I have no intention to update them with the newer updates from the Flutter Team |
[google_sign_in 4.5.6] I still get serverAuthCode as null. |
use the solution provided by : @aseef17
|
@ManasviPatidar |
@aseef17 This is the issue:- |
I have the same issue regarding quiver dependency:
|
@aseef17's workaround has done well for a while, but version solving has become an issue as we've updated other dependencies in our project. Integrating GoogleSignInPlatform has not helped either, as getTokens also returns a null serverAuthCode. Google sign in is useless for our purposes without the serverAuthCode. |
I'll try to update the dependencies by this weekend. I still don't understand why the Flutter team has not integrated this yet though. |
@aseef17 Obviously I didn't expect you to have to do that kind of work, but of course I appreciate it. |
This solution works for me in mobile device however in web I still got null value |
It would be great to get this issue fixed as it is a blocker for anyone who wants to do server-side authentication for Google sign-in. I did a null-safe version that is working for me. Just add the git dependency:
It's possible you also need to add to your GoogleService-Info.plist (didn't try without):
You can find it in your firebase project settings or you can just check your google-services.json file |
It's pretty astonishing this issue, which makes server side authentication impossible, has gone unaddressed over almost a dozen new versions. |
i implement this,,still my serverauthcode is comming null. |
@OhTerryTorres your proposed solution doesn't work on Android (but works on iOS). Do you have any ideas why? |
I got it working on Android but the server throws |
I tried @vlidholt 's branch but after I hit login, the simulator would always crash. However, when I ran the same code but with the default google_sign_in library (5.0.7), I got null as the response when trying to get the serverAuthCode. Does any know why the simulator would crash? |
This took me a few hours to get working. So to save everyone's time, here are the steps I took. Part 1: Fork repo
Part 2: Create Client ID
Part 3a: Setup Android
Part 3b: Setup iOS
Part 4: Override dependencies
|
Thanks for your work, it works fine on Android and iOS. On the other hand, I cannot launch the application on the iOS simulator because of an error. You know why?
|
If anyone is still seeking a solution, here's a web implementation of a custom google sign in client: https://stackoverflow.com/questions/69746035/flutter-web-google-sign-in-how-to-retrieve-refreshtoken/69746036#69746036 |
Closing as fixed by flutter/plugins#4180 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The serverauthcode still coming null in the new version of plugin.
Flutter doctor
The text was updated successfully, but these errors were encountered: