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!
```
Description
There is an issue with Firebase Auth with macOS.
By default, on a brand new project, running this code:
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 thesignIn
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! ```