Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[google_sign_in] Add doc for iOS auth with SERVER_CLIENT_ID #4747

Merged
merged 8 commits into from
Jan 28, 2023
4 changes: 4 additions & 0 deletions packages/google_sign_in/google_sign_in/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.2.3+1
Milvintsiss marked this conversation as resolved.
Show resolved Hide resolved

* 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`.
Expand Down
14 changes: 14 additions & 0 deletions packages/google_sign_in/google_sign_in/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ This plugin requires iOS 9.0 or higher.
<!-- End of the Google Sign-in Section -->
```

### iOS Authenticate with backend server
Milvintsiss marked this conversation as resolved.
Show resolved Hide resolved

If you use Google Sign-In with an app that communicates with a backend server,
Milvintsiss marked this conversation as resolved.
Show resolved Hide resolved
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`.
Milvintsiss marked this conversation as resolved.
Show resolved Hide resolved

To do so you need to add a `SERVER_CLIENT_ID` key value pair in your `GoogleService-Info.plist`:

```xml
<key>SERVER_CLIENT_ID</key>
<string>[YOUR SERVER CLIENT ID]</string>
```

#### iOS additional requirement

Note that according to
Expand Down
2 changes: 1 addition & 1 deletion packages/google_sign_in/google_sign_in/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down