Skip to content
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

Catalyst and Firebase: get permission denied when accessing the database #4144

Closed
rawmean opened this issue Oct 23, 2019 · 4 comments
Closed

Comments

@rawmean
Copy link

rawmean commented Oct 23, 2019

Describe your environment

Xcode version: 11.1
Firebase SDK version: 6.11.0
Firebase Component: RealTime Database
Component version:
Firebase 6.11.0
FirebaseAnalytics (6.1.3)
FirebaseInstanceID (4.2.6)
GoogleAppMeasurement (6.1.3)
GoogleUtilities 6.3.1

Describe the problem
The iOS app works perfectly and can access the firebase database, but the Catalyst app gives the following error:

6.11.0 - [Firebase/Database][I-RDB038012] Listener at /my_database/path failed: permission_denied

'openssl_grpc/ssl.h' file not found
'openssl_grpc/bn.h' file not found
'openssl_grpc/rsa.h' file not found
'openssl_grpc/bio.h' file not found
I have no issues when I run the project.

Steps to reproduce:

iOS code:

            let ref = Database.database().reference(withPath: databasePath)
            ref.observeSingleEvent(of: .value, with: { (snapshot) in
                ...
            }

my PodFile:

platform :ios, '11.0'

def reusepods
end

target 'MyTargerName' do
    use_frameworks!
#    pod 'Firebase/Core'
    pod 'FirebaseCore'
    pod 'Firebase/Database'
    pod 'Firebase/Auth'
    pod 'Charts'
    pod 'EMAlertController'    
end

The firebase rules are as follows for the path that the app accesses (note that the iOS app can access this path with no error):

          ".read": "auth != null",
          ".write": "auth != null"
@google-oss-bot

This comment has been minimized.

@ryanwilson
Copy link
Member

Thanks for the report @rawmean, this may be a silly question but is the Auth user properly logged in? Specifically, checking if Auth.auth()?.currentUser is nil or not right before the read.

This is just the first step in debugging what's going on here, hopefully we can get this resolved quickly for you.

@rawmean
Copy link
Author

rawmean commented Oct 23, 2019

It turned out that I need to add "Keychain sharing" as a capability even though the app does not use Keychains. This is only necessary for the Mac app.

@paulb777
Copy link
Member

Yep. Thanks for sharing. We've documented that requirement for Auth on Catalyst so far at #3144.

@firebase firebase locked and limited conversation to collaborators Nov 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants