From 477bd85693b4e546d97af46f01bd84a68d5876f0 Mon Sep 17 00:00:00 2001 From: Milvintsiss Date: Mon, 7 Feb 2022 19:48:45 +0100 Subject: [PATCH 1/5] Add doc for iOS auth with SERVER_CLIENT_ID --- .../google_sign_in/google_sign_in/CHANGELOG.md | 4 ++++ packages/google_sign_in/google_sign_in/README.md | 14 ++++++++++++++ .../google_sign_in/google_sign_in/pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 183edaddf625..471fec8b2737 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.2.3+1 + +* Add doc for iOS auth with SERVER_CLIENT_ID + ## 5.2.3 * Bumps the Android dependency on `com.google.android.gms:play-services-auth` and therefore removes the need for `jetifier`. diff --git a/packages/google_sign_in/google_sign_in/README.md b/packages/google_sign_in/google_sign_in/README.md index f3787474eeef..bf3260fd0eb4 100644 --- a/packages/google_sign_in/google_sign_in/README.md +++ b/packages/google_sign_in/google_sign_in/README.md @@ -61,6 +61,20 @@ This plugin requires iOS 9.0 or higher. ``` +### iOS Authenticate with backend server + +If you use Google Sign-In with an app that communicates with a backend server, +you might need to identify the currently signed-in user on the server. +To check the integrity of the token on your server you need to add an extra +`aud` field in the `idToken`. + +To do so you need to add a `SERVER_CLIENT_ID` key value pair in your `GoogleService-Info.plist`: + +```xml +SERVER_CLIENT_ID +[YOUR SERVER CLIENT ID] +``` + #### iOS additional requirement Note that according to diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 40f8d0f5f02c..4f0ef56e921f 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.2.3 +version: 5.2.3+1 environment: sdk: ">=2.14.0 <3.0.0" From b03f394073d1dd957a2da0546865b31ed73103f9 Mon Sep 17 00:00:00 2001 From: Milvintsiss Date: Fri, 11 Feb 2022 10:54:28 +0100 Subject: [PATCH 2/5] Follow pub versioning guidelines --- packages/google_sign_in/google_sign_in/CHANGELOG.md | 2 +- packages/google_sign_in/google_sign_in/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 471fec8b2737..b965434f71d9 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,4 +1,4 @@ -## 5.2.3+1 +## 5.2.4 * Add doc for iOS auth with SERVER_CLIENT_ID diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 4f0ef56e921f..9002692774b9 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.2.3+1 +version: 5.2.4 environment: sdk: ">=2.14.0 <3.0.0" From 4fd1d9605f420d143a59a92bd64440280c4bddf3 Mon Sep 17 00:00:00 2001 From: Milvintsiss Date: Sat, 26 Feb 2022 02:11:16 +0100 Subject: [PATCH 3/5] Remove incorrect documentation saying that `clientId` is only configurable on web. --- packages/google_sign_in/google_sign_in/lib/google_sign_in.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart index e104093c69bc..0cc451c938a8 100644 --- a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart @@ -225,7 +225,7 @@ class GoogleSignIn { /// Domain to restrict sign-in to. final String? hostedDomain; - /// Client ID being used to connect to google sign-in. Only supported on web. + /// Client ID being used to connect to google sign-in. final String? clientId; StreamController _currentUserController = From 8ea46bb51d902cab4bb18da2e13d65270bd39fff Mon Sep 17 00:00:00 2001 From: Milvintsiss Date: Mon, 8 Aug 2022 10:25:13 +0200 Subject: [PATCH 4/5] Revert "Add doc for iOS auth with SERVER_CLIENT_ID" This reverts commit 477bd85693b4e546d97af46f01bd84a68d5876f0. --- .../google_sign_in/google_sign_in/CHANGELOG.md | 4 ---- packages/google_sign_in/google_sign_in/README.md | 14 -------------- .../google_sign_in/lib/google_sign_in.dart | 2 +- .../google_sign_in/google_sign_in/pubspec.yaml | 2 +- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index b965434f71d9..183edaddf625 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,7 +1,3 @@ -## 5.2.4 - -* Add doc for iOS auth with SERVER_CLIENT_ID - ## 5.2.3 * Bumps the Android dependency on `com.google.android.gms:play-services-auth` and therefore removes the need for `jetifier`. diff --git a/packages/google_sign_in/google_sign_in/README.md b/packages/google_sign_in/google_sign_in/README.md index bf3260fd0eb4..f3787474eeef 100644 --- a/packages/google_sign_in/google_sign_in/README.md +++ b/packages/google_sign_in/google_sign_in/README.md @@ -61,20 +61,6 @@ This plugin requires iOS 9.0 or higher. ``` -### iOS Authenticate with backend server - -If you use Google Sign-In with an app that communicates with a backend server, -you might need to identify the currently signed-in user on the server. -To check the integrity of the token on your server you need to add an extra -`aud` field in the `idToken`. - -To do so you need to add a `SERVER_CLIENT_ID` key value pair in your `GoogleService-Info.plist`: - -```xml -SERVER_CLIENT_ID -[YOUR SERVER CLIENT ID] -``` - #### iOS additional requirement Note that according to diff --git a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart index 0cc451c938a8..e104093c69bc 100644 --- a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart @@ -225,7 +225,7 @@ class GoogleSignIn { /// Domain to restrict sign-in to. final String? hostedDomain; - /// Client ID being used to connect to google sign-in. + /// Client ID being used to connect to google sign-in. Only supported on web. final String? clientId; StreamController _currentUserController = diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 9002692774b9..40f8d0f5f02c 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.2.4 +version: 5.2.3 environment: sdk: ">=2.14.0 <3.0.0" From c83ac997da9dfb3aa44b5b8eea4af9010fe7501c Mon Sep 17 00:00:00 2001 From: Milvintsiss Date: Mon, 8 Aug 2022 15:05:01 +0200 Subject: [PATCH 5/5] Adds documentation for iOS auth with SERVER_CLIENT_ID --- .../google_sign_in/google_sign_in/CHANGELOG.md | 4 ++++ packages/google_sign_in/google_sign_in/README.md | 16 +++++++++++----- .../google_sign_in/google_sign_in/pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 7e433a71368f..3f88714bc965 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.4.1 + +* Adds documentation for iOS auth with SERVER_CLIENT_ID + ## 5.4.0 * Adds support for configuring `serverClientId` through `GoogleSignIn` constructor. diff --git a/packages/google_sign_in/google_sign_in/README.md b/packages/google_sign_in/google_sign_in/README.md index e467ca8541b9..6961bc67b7df 100644 --- a/packages/google_sign_in/google_sign_in/README.md +++ b/packages/google_sign_in/google_sign_in/README.md @@ -43,7 +43,13 @@ This plugin requires iOS 9.0 or higher. 5. Select `GoogleService-Info.plist` from the file manager. 6. A dialog will show up and ask you to select the targets, select the `Runner` target. -7. Then add the `CFBundleURLTypes` attributes below into the +7. If you need to authenticate to a backend server you can add a + `SERVER_CLIENT_ID` key value pair in your `GoogleService-Info.plist`. + ```xml + SERVER_CLIENT_ID + [YOUR SERVER CLIENT ID] + ``` +8. Then add the `CFBundleURLTypes` attributes below into the `[my_project]/ios/Runner/Info.plist` file. ```xml @@ -65,9 +71,9 @@ This plugin requires iOS 9.0 or higher. ``` -As an alternative to adding `GoogleService-Info.plist` to your Xcode project, you can instead -configure your app in Dart code. In this case, skip steps 3-6 and pass `clientId` and -`serverClientId` to the `GoogleSignIn` constructor: +As an alternative to adding `GoogleService-Info.plist` to your Xcode project, +you can instead configure your app in Dart code. In this case, skip steps 3 to 7 + and pass `clientId` and `serverClientId` to the `GoogleSignIn` constructor: ```dart GoogleSignIn _googleSignIn = GoogleSignIn( @@ -79,7 +85,7 @@ GoogleSignIn _googleSignIn = GoogleSignIn( ); ``` -Note that step 7 is still required. +Note that step 8 is still required. #### iOS additional requirement diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index c7724adcebad..8286f6bd9b0e 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.4.0 +version: 5.4.1 environment: