firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.62k stars 1.47k forks source link

[11.3.0] Auth: macOS not working "required entitlement" error #13934

Open Vincz opened 2 hours ago

Vincz commented 2 hours ago

Description

There is an issue with Firebase Auth with macOS.
By default, on a brand new project, running this code:

func signIn(email: String, password: String) {
        print("Signin \(email)")
        Auth.auth().signIn(withEmail: email, password: password) { result, error in
            print("Result signin \(result), error \(error?.localizedDescription ?? "")")
            if let error = error {
                print((error as NSError).userInfo)
        }
    }
}

Will result with the following error (if the credentials are correct) : Result signin nil, error An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered ["NSLocalizedDescription": "An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered", "FIRAuthErrorUserInfoNameKey": "ERROR_KEYCHAIN_ERROR", "NSLocalizedFailureReason": "SecItemAdd (-34018) A required entitlement isn\'t present."]

Adding the Keychain sharing capability with a group and running the code again, will result in the signIn completion handler never get called.

The same code is working as expected in IOS simulator.

Reproducing the issue

No response

Firebase SDK Version

11.3

Xcode Version

16.0

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS, macOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 2 hours ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.