From 927f22a23ec1fd2963fe9173678bc8880d867143 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:25:10 -0400 Subject: [PATCH 1/3] [Auth] Query with `kSecAttrSynchronizable` when auth sharing enabled --- .../Sources/Swift/SystemService/AuthStoredUserManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift b/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift index ae2cb1d7d0a..1bfdf083219 100644 --- a/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift +++ b/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift @@ -161,6 +161,10 @@ class AuthStoredUserManager { ] query[kSecUseDataProtectionKeychain as String] = true + if (shareAuthStateAcrossDevices) { + query[kSecAttrSynchronizable as String] = true + } + return query } } From f79be9eb1aa11d9733ac398827d0b7178b97d2c6 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:31:15 -0400 Subject: [PATCH 2/3] style --- .../Sources/Swift/SystemService/AuthStoredUserManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift b/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift index 1bfdf083219..b9471dc891f 100644 --- a/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift +++ b/FirebaseAuth/Sources/Swift/SystemService/AuthStoredUserManager.swift @@ -161,7 +161,7 @@ class AuthStoredUserManager { ] query[kSecUseDataProtectionKeychain as String] = true - if (shareAuthStateAcrossDevices) { + if shareAuthStateAcrossDevices { query[kSecAttrSynchronizable as String] = true } From 8c5af6286b0873b37957ebb76aa5add465ba372d Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:47:19 -0400 Subject: [PATCH 3/3] changelog --- FirebaseAuth/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FirebaseAuth/CHANGELOG.md b/FirebaseAuth/CHANGELOG.md index 81388ecef86..60e625d55de 100644 --- a/FirebaseAuth/CHANGELOG.md +++ b/FirebaseAuth/CHANGELOG.md @@ -1,3 +1,8 @@ +# Unreleased +- [Fixed] Restore Firebase 10 behavior by querying with the + `kSecAttrSynchronizable` key when auth state is set to be shared across + devices. (#13584) + # 11.2.0 - [Fixed] Fixed crashes that could occur in Swift continuation blocks running in the Xcode 16 betas. (#13480)