-
Notifications
You must be signed in to change notification settings - Fork 4k
Release & Debug version of the app asking keychain permissions #8811
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
I found a few problems with this issue:
|
Sorry about the trouble.
|
We had to disable it and resort to Web-sockets and local notifications for MacOS. It's fairly strange for the plugin to ask for chain access 8 times, feels very wrong.
|
This might be a Flutter specific issue, since we haven't had seen this issue with ObjC/Swift apps. I'll transfer the issue. |
@paulb777 disabling the library stops with |
One more thought since the issue sounds similar to a development-only workflow we've seen for macOS. How is the app distributed? We would expect App Store signing to obviate the need for any keychain permission popups. |
@paulb777 yes I originally thought that but release mode and signing made no difference. When released via the App Store the MacOS app was asked for keychain 8 times on launch. |
@OllyDixon |
@darshankawar indeed. Multiple times on every launch. Something that is not acceptable for a user journey. |
Ok, can you try by removing sandbox capability from runner from macOS Xcode project and see if it helps ? |
Hey @OllyDixon. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 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! |
@darshankawar sorry for the delay. We removed firebase in this project and are using an alternative push notifications system because of this bug. I’m sure the sample app will give the same bug for MacOS :-) |
@OllyDixon Incase you have more info for us regarding how to reproduce the issue, feel free to write back. |
Made a sample project and managed to reproduce it. Some (for me easily overlooked steps). In Xcode setting the signing to your own signing (so not Sign to run Locally). Adding the Firebase.configure() into the AppDelegate.swift (if this is wrong please let me know). In our project we use Firebase Crashlytics and Firebase Messaging and I saw the same for @maheshmnj so I also added it in the pubspec. I made a video of the entire process but the interesting stuff only happens at the end of the video (besides uploading the repo to git :p oh no google api secret exposed!!!). Repo with sample project: https://github.com/TammiLion/macos_keychain_firebase_attempt2 Here is the google drive link to the 40+ min video. https://drive.google.com/file/d/1oXZEAc0U7abGL2Fe1ygDUPUXf-WOFVBL/view?usp=sharing You might ask yourself, why add those things when they are not in the MacOS installation documentation (flutter documentation without MacOS specifics - https://firebase.google.com/docs/flutter/setup?platform=ios#next_steps). |
@TammiLion Thank you for sharing your setup. The video is only 26 seconds long, but I didn't need to watch it anyway. You do not need to add @tommienu did you also add |
Nope, here's my AppDelegate.swift:
I believe I've configured this according to the documentation. |
FWIW, this sounds like a regression from this old issue from 2020. Which was fixed in Firebase release 6.26.0, according to this comment. Understanding what changed there might assist with understanding why it's now resurfacing. Edit: Please notice this post @ncooke3. I believe this will assist while debugging firebase/firebase-ios-sdk#9392. |
Folks, I have been following this conversation closely over the last few days and I'm super confused as to whether there is a resolution for this issue or not. @russellwheatley seems to feel that this is a user configuration issue, yet @TammiLion is able to reproduce the issue, and @tommienu thinks there is a regression. Do we know what's going on here yet or is this still an ongoing investigation? |
@russellwheatley thanks for the answer. I removed the Firebase.configure() from the AppDelegate.swift in the sample project (also committed it to git). Unfortunately the problem still occurs. I also tested with App sandbox allowed/disallowed and it made no difference. Here's the actual video (once again, might not be immediately available due to drive processing it, will also edit the old comment): https://drive.google.com/file/d/1oXZEAc0U7abGL2Fe1ygDUPUXf-WOFVBL/view?usp=sharing |
Hi everyone, Apologies for the trouble here and thank you for all the useful information. The firebase-ios-sdk team is aware of the issue and we have been actively working on a fix to resolve this. This issue has popped up in a few GitHub issues so I'm going to centralize communications in firebase-ios-sdk/#9392, but I will also update this thread when I have a more substantial update. I will share another update soon! |
Hi everyone, I have an update here. We have a fix that is currently planned for release in Firebase 9.6.0 next week. Thanks! |
Hi everyone, Just a quick fyi that Firebase 9.6.0 has been released. This release should unblock this issue @darshankawar. Please continue the conversation here or in firebase-ios-sdk/#9392 if the issue persists. As noted in this comment and in the release notes, please enable the Keychain Sharing capability for your macOS targets to make sure everything works properly. Thanks! |
@OllyDixon Please check above comment and re-verify to confirm. |
@ncooke3 do customers need to enable keychain sharing for their apps? As that won’t be an option. I don’t see other MacOS apps requesting this; and if they do I reject. Apple will reject our apps without valid reason for keychain access. What is the reason for us enabling it? I don’t see the point and it’s not explained. Non of our apps ‘SDKs’ use the keychain .. If this is the case the original issue is not resolved. Apple provides a very simple push notifications service/key like on iOS; why is Firebase not utilizing this? Why is it using the keychain in the first place? |
Hi @OllyDixon Thank you for the questions. I have answered each one below.
Please let me know if you have further questions. |
Thanks for the info.
Why not use library folder/cache or app folder for this. Storing it inside the key-chain seems a bit strange? You're asking us expose sensitive data, our key-chains might contain passwords and other items that we don't want to expose to any SDK's inside our app.
If we get an awkward reviewer which sometimes happens, we still have no reason to use the keychain. Our answer can't be 'cause some SDK inside our app uses it' they won't accept that. |
Hi @OllyDixon,
Firebase uses the keychain to store various bits of SDK data. For example, Firebase Auth allows you to manage user accounts. Account information is a good example of something that the Keychain is designed to store. Storing such information in the keychain is done to protect such information. When SDKs are designed, a storage solution is chosen based on the requirements at that time. That said, we are working on reviewing our use of the Keychain, and if we find that the Keychain's security is not needed, then we will migrate away as necessary. We will be working on this and any resulting changes can be expected in a Firebase 10.X.0 release.
The Keychain can store all sorts of data. And it has its own trade-offs just like any other storage solution (File System, User Defaults, database, etc.). While I was not involved in its design, I believe Firebase Installation tokens were stored in the keychain rather than an unprotected storage container out of an abundance of caution. And as I said in my previous answer, it's worth us examining whether or not the SDK needs to be that defensive. From an implementation and testability perspective, the Keychain can be difficult to deal with because of its API surface. So there are multiple benefits to not using the Keychain (as long as the data does not pose a risk by being stored in an unsecure container).
Nobody is asking that. Just because an SDK uses the keychain does not mean that it can access such items. Each Keychain items has a dictionary of attributes that are unique to that item. These are defined by you, the developer, and Firebase has no idea what those attributes are. It is only aware of the Keychain items that it creates. I'm happy to point you to code in the Firebase SDK that accesses the keychain. Everything is here.
I understand. I think the justification can be more detailed as this is ultimately something that is trying to improve your app's user experience. Firebase Installations provides a table that provides a justification for why the SDK is used for each product. For instance, if you are using Firebase Messaging, it uses Installations to target devices for message delivery. The keychain is used to securely store the ID used to target that particular device. Apologies if you are still not convinced. The fix in Firebase 9.6.0 was intended to quickly unblock Firebase developers targeting macOS apps. I will have more info in the coming weeks regarding what Firebase SDKs may be updated to move away from using the Keychain. |
Thanks for the reply. Still not convinced; have many more questions and security pokes; but I won’t take anymore time. Really it’s a shame Google can’t give us a simple messaging service without using Firebase (which was GCM on Android and APN on Apple). Forcing developers to go though Firebase to increase sales; seems antitrust. Us developers always get screwed by this mobile duopoly 🤪 For us the keychain issue is still a deal breaker and a risk not worth taking. That keychain code could change at anytime exposing users sensitive data. We decided to go with our own solution on MacOS 😎 Thanks for your help. |
@ncooke3 it seems like |
Check this PR : #9531 |
@darshankawar that's great, but |
Related to firebase/firebase-ios-sdk#5540
When launching the app customers are reporting that they are asking for sensitive key-chain access.
We had to include Firebase Core in order to get FCM working..
Anyway around this? It's not acceptable to ask 8 times for Keychain access everytime the customer launches and many refuse to use "Always allow" which is completely reasonable.
The text was updated successfully, but these errors were encountered: