-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Firebase Auth - Signing users out after 30 minutes (As of Xcode 13, iOS 15 SDK). #8695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report and sorry for the troubles. Does this happen in debug builds as well as release builds? Any extra steps or details you can share would be helpful as we try to reproduce this. Are any logs produced in the console? We do log a few errors if the SDK has trouble loading the user. Stepping through this code would help as well: firebase-ios-sdk/FirebaseAuth/Sources/Auth/FIRAuth.m Lines 492 to 530 in a550e68
|
We are seeing the same issue with our App. Only iOS 15. Xcode version: 12.5 |
@rshubbard sorry for the troubles, can you please try the above steps and share any logs / step through the debugger in the code I linked above to try to reproduce this? We have a couple people trying to reproduce this but currently we're unable to. We're hoping we can catch this and get it fixed ASAP for folks so any repro would be very helpful! |
I have been unable to reproduce it in a debuggable state. We are only able to reproduce on 2 devices. On an iPhone 12 running iOS 15 I can reproduce 90% of the time if I shut down and power up the device. On older device running iOS 15, we can reproduce it if we wait an hour but also task it with other apps while it is backgrounded. The issue is definitely getting reported by our users as they are upgrading to iOS 15. |
@rshubbard @cvcoder1 can you please share which function you're calling This forum post looks like it could be relevant, and that the keychain data and user defaults aren't available very early on in an app's lifecycle (presumably from cold start). |
@ryanwilson nothing related to the forum post on our end. However, I just noticed we were calling FirebaseAppCheck prior to FirebaseApp.configure(). Could this be the cause?
|
We'll push a version to App Store Connect and test there as well. This occurs when following my test procedure above, (after) building in Xcode on device, then unplugging, terminating and starting up again. |
Re-arranged the app check config to be after 'FirebaseApp.configure()' - same behavior still occurring... @ryanwilson |
Hey Ryan, we are using React Native Firebase (https://rnfirebase.io/). Here is our code to initialize in ios/PlaymetricsMobile/AppDelegate.m: @implementation AppDelegate
|
@rshubbard @cvcoder1 Could you please share the device logs relevant to the app for the period of time when the issue is reproducible on your device? We expect to see messages like Here is an example how you may get the logs using Xcode. |
I don't see anything from Firebase/Auth but I did see this: 8.7.0 - [Firebase/Messaging][I-FCM023014] Error while reading embedded mobileprovision Error Domain=NSCocoaErrorDomain Code=260 "The file “embedded.mobileprovision” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/private/var/containers/Bundle/Application/3C9A250A-2DDA-4CF1-A9FF-D32C976D4009/PlayMetrics.app/embedded.mobileprovision, NSUnderlyingError=0x281b7cba0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} |
I also see: Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50]) deleted <genp,acct=firebase_auth_1___FIRAPP_DEFAULT_firebase_user,svce=firebase_auth_1:...:ios:...,agrp=BT8MVHD5Q2.com.playmetrics.mcr,sync=0,musr=, |otherAttr,tomb=0,rowid=945,cdat=2021-09-27 16:15:58 +0000,mdat=2021-09-27 16:15:58 +0000,pdmn=cku,sha1=... |
Ok thanks. Will do shortly. Closing the issue was accident. Github should definitely prompt an 'are you sure' in case of house cats jumping on keyboard.. |
Is 'BuddyBuilds' relevant other than the sample tutorial of how to get Xcode logs? Confused there.. |
@cvcoder1 BuddyBuild is a testing service unrelated to Firebase. They happened to have an informative blog post on how to get logs from Xcode. You don't need to use BuddyBuild to be able to access logs from Xcode. |
OK my issue seems to be the internet connection. On phone reset you can start the application before the network connection has been established so I am adding a check for that. |
@rshubbard Thank you for the updates. We are still unsure what's the core reason of the issue. Could you please share all log entries with "[Firebase/" in them for the app run when the issue occurs. Hopefully it will give us more information on the issue. |
Hi folks, sorry that you're experiencing this issue! A few questions: @cvcoder1 What iPhone versions have you been experiencing this on? In addition, is it only on a physical device or have you also been able to reproduce this on a simulator? And to clarify the behavior you're seeing, is it that the @rshubbard You mentioned that one of the devices you reproduced this on was an iPhone 12, after restarting the device. Was this in addition to waiting the 31 minutes mentioned in the repro steps of the first comment, or do you see the user signed out without the wait time? In addition, if either of you can share any device logs (specifically log entries prefixed with To turn on debug logs: |
Hey @cvcoder1. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @cvcoder1 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Hey folks, it looks like this article gives some good information on what could be happening - iOS 15 tries to optimize things and pre-load apps before they launch, meaning the keychain read will fail. I'll re-open this and discuss it with the Auth team since there are some potential workarounds or optimizations we could do to alleviate the issue. In particular, I'm thinking we should try to hook into the |
Hey @rosalyntan, do you think the potential workaround is reasonable, or any other thoughts on how we could mitigate this? |
Hey folks, any update about this fix? |
[REQUIRED] Step 1: Describe your environment
(Added by me):
[REQUIRED] Step 2: Describe the problem
After about 30 min., users are being signed out by Firebase automatically. This behavior did not occur prior to iOS 15. My company has in place, multiple safeguards via the iOS SDK & Cloud Functions for Auth. This issue is only occurring as of iOS 15.0.
Steps to reproduce:
Tested on both phone auth & Sign in with Apple:
Test 1:
Sign in --> Terminate application -> Open app after 5 minutes --> still logged in.
Test 2:
Sign in --> Terminate application -> Open app after 25 minutes --> still logged in.
Test 3:
Sign in -> Terminate application --> Open app after 31 minutes --> logged out of firebase.
What happened? How can we make the problem occur?
This just started happening as of iOS 15 & Xcode 13.
We have tests in place in our development environment to ensure things like this are not our fault.
And, our application in the store is not experiencing this behavior.
Relevant Code:
N/A.
The text was updated successfully, but these errors were encountered: