Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to set the serverClientID needed for serverAuthCode (Switching from iOS)? #57945

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

Closed
JacobWrenn opened this issue May 25, 2020 · 11 comments · Fixed by flutter/plugins#5250
Closed
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter p: google_sign_in The Google Sign-In plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. r: fixed Issue is closed as already fixed in a newer version

Comments

@JacobWrenn
Copy link

In my previous iOS application, I could get a serverAuthCode that I could pass to my own server that was then able to redeem tokens using its own client ID and make API requests on behalf of the user.

I used to be able to specify GIDSignIn.sharedInstance()?.serverClientID = "12345.apps.googleusercontent.com" to tell the library the client ID of my server. I would like to know how to set this in Flutter.

@JacobWrenn
Copy link
Author

Note: I am using the latest version of Flutter's official google_sign_in plugin.

@iapicca
Copy link
Contributor

iapicca commented May 25, 2020

Hi @JacobWrenn
This platform is not meant for assistance on personal code. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow.
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

@JacobWrenn
Copy link
Author

Hi @iapicca yes, I agree. However Google's official google sign in plugin for Flutter says to leave feedback here. I think that this is a missing feature compared to the library on other platforms (unless I have just not found the right docs).

@iapicca
Copy link
Contributor

iapicca commented May 26, 2020

Hi @JacobWrenn
the goal of this github repository
is to improve flutter's framework and first party plugins
through bug reports and feature request;

at first sight your issue seems to be a request
for assistance on your implementation of google_sign_in.

If this is not the case please describe the issue with said plugin in details
Thank you

@JacobWrenn
Copy link
Author

Ok @iapicca, I will rephrase as a feature request.

google_sign_in should have support for setting a serverClientID (used as the audience parameter in the OAuth login URL). This is a feature in other first-party google sign in libraries.

An example of how this could look alongside existing options would be:

final GoogleSignIn google = GoogleSignIn(scopes: ["email"], clientId: "abc123", serverClientId: "def456");
google.signIn();

@iapicca iapicca reopened this May 26, 2020
@iapicca iapicca added p: first party p: google_sign_in The Google Sign-In plugin c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability labels May 26, 2020
@ditman
Copy link
Member

ditman commented Jan 11, 2021

The serverClientId parameter has been moved to the native configuration of the app (xml/plist) from the programmatic initialization.

See the updated example app here: flutter/plugins#2116.

Is the programmatic initialization still required?

@ditman ditman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 11, 2021
@pedromassangocode
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@pedromassangocode pedromassangocode added r: timeout Issue is closed due to author not providing the requested details in time and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Feb 3, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
@cyanglaz cyanglaz reopened this Feb 24, 2022
@cyanglaz
Copy link
Contributor

I think this is a valid proposal and we should implement this. @ditman @stuartmorgan

@stuartmorgan-g stuartmorgan-g added the P3 Issues that are less important to the Flutter project label Feb 24, 2022
@ditman
Copy link
Member

ditman commented Apr 12, 2022

@cyanglaz is this because the serverClientId is a per-user value (like an ID Token) rather than a per-app config value?

@jmagman
Copy link
Member

jmagman commented Jul 7, 2022

This should have closed when flutter/plugins#5250 merged. Available in google_sign_in 5.4.0.

@jmagman jmagman closed this as completed Jul 7, 2022
@danagbemava-nc danagbemava-nc removed the r: timeout Issue is closed due to author not providing the requested details in time label Jul 8, 2022
@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Jul 8, 2022
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter p: google_sign_in The Google Sign-In plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants