diff --git a/AUTHORS b/AUTHORS index b3957d26e36a..75848e05ba77 100644 --- a/AUTHORS +++ b/AUTHORS @@ -53,3 +53,4 @@ Nissim Dsilva Giancarlo Rocha Ryo Miyake Théo Champion +Kazuki Yamaguchi \ No newline at end of file diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md index c0627df8c1da..c342c550c85a 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.1 + +* Add attribute serverAuthCode. + ## 1.1.0 * Add hasRequestedScope method to determine if an Oauth scope has been granted. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart index d69beb38a104..c60402200bdd 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart @@ -82,7 +82,11 @@ class GoogleSignInUserData { /// Holds authentication data after sign in. class GoogleSignInTokenData { /// Either or both parameters may be null. - GoogleSignInTokenData({this.idToken, this.accessToken}); + GoogleSignInTokenData({ + this.idToken, + this.accessToken, + this.serverAuthCode, + }); /// An OpenID Connect ID token for the authenticated user. String idToken; @@ -90,8 +94,11 @@ class GoogleSignInTokenData { /// The OAuth2 access token used to access Google services. String accessToken; + /// Server auth code used to access Google Login + String serverAuthCode; + @override - int get hashCode => hash2(idToken, accessToken); + int get hashCode => hash3(idToken, accessToken, serverAuthCode); @override bool operator ==(dynamic other) { @@ -99,6 +106,7 @@ class GoogleSignInTokenData { if (other is! GoogleSignInTokenData) return false; final GoogleSignInTokenData otherTokenData = other; return otherTokenData.idToken == idToken && - otherTokenData.accessToken == accessToken; + otherTokenData.accessToken == accessToken && + otherTokenData.serverAuthCode == serverAuthCode; } } diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart index eb60f00cba63..1ae828604af6 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart @@ -25,5 +25,6 @@ GoogleSignInTokenData getTokenDataFromMap(Map data) { return GoogleSignInTokenData( idToken: data['idToken'], accessToken: data['accessToken'], + serverAuthCode: data['serverAuthCode'], ); } diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml index d1f7abc291c4..248471764605 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the google_sign_in plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.1.0 +version: 1.1.1 dependencies: flutter: diff --git a/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart index 6a8f73736004..5ac34ade1b8d 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; import 'package:google_sign_in_platform_interface/src/types.dart'; import 'package:google_sign_in_platform_interface/src/utils.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; const Map kUserData = { "email": "john.doe@gmail.com", @@ -18,6 +18,7 @@ const Map kUserData = { const Map kTokenData = { 'idToken': '123', 'accessToken': '456', + 'serverAuthCode': '789', }; const Map kDefaultResponses = {