@@ -81,13 +81,14 @@ class IdentitySignInServiceImpl(private val context: Context, private val client
8181 }
8282 val bundle = Bundle ().apply {
8383 val options = GoogleSignInOptions .Builder (GoogleSignInOptions .DEFAULT_SIGN_IN )
84+ .requestEmail()
8485 .requestIdToken(request.googleIdTokenRequestOptions.serverClientId).build()
8586 putByteArray(BEGIN_SIGN_IN_REQUEST , SafeParcelableSerializer .serializeToBytes(request))
8687 putByteArray(GOOGLE_SIGN_IN_OPTIONS , SafeParcelableSerializer .serializeToBytes(options))
8788 putString(CLIENT_PACKAGE_NAME , clientPackageName)
8889 requestMap[request.sessionId] = options
8990 }
90- callback.onResult(Status .SUCCESS , BeginSignInResult (performGooogleSignIn (bundle)))
91+ callback.onResult(Status .SUCCESS , BeginSignInResult (performGoogleSignIn (bundle)))
9192 } else if (request.passkeyJsonRequestOptions.isSupported) {
9293 fun JSONObject.getArrayOrNull (key : String ) = if (has(key)) getJSONArray(key) else null
9394 fun <T > JSONArray.map (fn : (JSONObject ) -> T ): List <T > = (0 until length()).map { fn(getJSONObject(it)) }
@@ -143,14 +144,16 @@ class IdentitySignInServiceImpl(private val context: Context, private val client
143144 }
144145 val bundle = Bundle ().apply {
145146 val options =
146- GoogleSignInOptions .Builder (GoogleSignInOptions .DEFAULT_SIGN_IN ).requestIdToken(request.serverClientId)
147+ GoogleSignInOptions .Builder (GoogleSignInOptions .DEFAULT_SIGN_IN )
148+ .requestEmail()
149+ .requestIdToken(request.serverClientId)
147150 .build()
148151 putByteArray(GET_SIGN_IN_INTENT_REQUEST , SafeParcelableSerializer .serializeToBytes(request))
149152 putByteArray(GOOGLE_SIGN_IN_OPTIONS , SafeParcelableSerializer .serializeToBytes(options))
150153 putString(CLIENT_PACKAGE_NAME , clientPackageName)
151154 requestMap[request.sessionId] = options
152155 }
153- callback.onResult(Status .SUCCESS , performGooogleSignIn (bundle))
156+ callback.onResult(Status .SUCCESS , performGoogleSignIn (bundle))
154157 }
155158
156159 override fun getPhoneNumberHintIntent (
@@ -160,7 +163,7 @@ class IdentitySignInServiceImpl(private val context: Context, private val client
160163 callback.onResult(Status .CANCELED , null )
161164 }
162165
163- private fun performGooogleSignIn (bundle : Bundle ): PendingIntent {
166+ private fun performGoogleSignIn (bundle : Bundle ): PendingIntent {
164167 val intent = Intent (ACTION_ASSISTED_SIGN_IN ).apply {
165168 `package` = context.packageName
166169 putExtras(bundle)
0 commit comments