google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
478 stars 194 forks source link

No auth in Keychain after app restart #332

Closed luca-rmg closed 1 year ago

luca-rmg commented 1 year ago

Hi,

I just upgraded from GoogleSignIn 5.0.2 to 7.0.0 and now I've a problem with restorePreviousSignIn response that fails with error code=-4 (see attached screenshot). Seems like the auth is not stored in the Keychain.

Steps to reproduce the behavior:

  1. Sign in -> success with valid user and access token
  2. Close and reopen the app
  3. Call hasPreviousSignIn -> return false
  4. Call restorePreviousSignIn -> get nil user and error code=-4
Schermata 2023-08-08 alle 15 52 03

At this point I also tried to uninstall the app, and install an older version of it (with GoogleSignIn 5.0.2), but I start to get a new keychain error (never seen before in years), see https://github.com/google/GoogleSignIn-iOS/issues/165

I think something strange is happening with Keychain groups. My Xcode project has Keychain Sharing capability enabled with 2 Keychain groups.

I already tried to call signOut, disconnect, and clean NSUserDefaults, nothing works. Now I'm stucked because I can't use either version.

Device: iPhone 12 pro, iPad Pro 2nd gen OS: iOS 16.3.1

Thanks

luca-rmg commented 1 year ago

I found the cause of the problem: I'm using JitsiMeetSDK as dependency and this one cause duplicated class, see https://github.com/jitsi/jitsi-meet/issues/13679