Firebase-js-sdk: Database permission_denied after linking a provider (linkWithPopup)

Created on 17 Oct 2017  路  6Comments  路  Source: firebase/firebase-js-sdk

[REQUIRED] Describe your environment

  • Operating System version: Windows 10 Chrome Version 63.0.3236.0 (Official Build) dev (64-bit)
  • Firebase SDK version: 4.5.1
  • Firebase Product: database, auth

[REQUIRED] Describe your environment

database write permission denied after linking other providers with a popup. updates in the same page before works as intended but after linking an other provider I get a warning

it used to work fine before updating js sdk

util.js:189 FIREBASE WARNING: update at /users/xxxxxxxx/data failed: permission_denied 
t.warn @ util.js:189
(anonymous) @ Repo.js:309
(anonymous) @ PersistentConnection.js:411
t.Tt @ PersistentConnection.js:444
e.Tt @ Connection.js:262
e.an @ Connection.js:256
(anonymous) @ Connection.js:157
t.Fn @ WebSocketConnection.js:197
t.handleIncomingFrame @ WebSocketConnection.js:247
mySock.onmessage @ WebSocketConnection.js:144
15:33:47.264 Repo.js:510 Uncaught (in promise) Error: PERMISSION_DENIED: Permission denied
    at Repo.js:510
    at Object.t.exceptionGuard (util.js:556)
    at e.callOnCompleteCallback (Repo.js:501)
    at Repo.js:314
    at PersistentConnection.js:411
    at t.Tt (PersistentConnection.js:444)
    at e.Tt (Connection.js:262)
    at e.an (Connection.js:256)
    at t.onMessage (Connection.js:157)
    at t.Fn (WebSocketConnection.js:197)

Steps to reproduce:

database rule ".write": "$uid === auth.uid"
main provider is Google to signin/ create an account in my app
try to write data to the current user ref after linking another provider with popup

=> https://local-guides-directory.firebaseapp.com/account

database

Most helpful comment

I was able to repro this with help from the discussion here:

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/firebase-talk/8UJISRriQjE/nRDbjkJNAgAJ

There seems to be an odd minification issue going on.

All 6 comments

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

I'm experiencing the same issue, after fresh install of my dependency tree which pulls latest version of firebase 4.5.2.

@khammami can you try with firebase version 4.5.0?

I forced 4.5.0 on my setup and the issue disappeared. Somehow it seems related to #223. I came across the idea to downgrade to 4.5.0 after ready this comment: https://github.com/firebase/firebase-js-sdk/issues/223#issuecomment-336610508

thanks @stivaliserna, I have already reverted to 4.5.0 as noticed the issues after updating my dependencies.

@stivaliserna @khammami, I spun up an isolate repro of this and was unable to reproduce the issue.

I went through the following path:

  1. Sign in with a fresh google account
  2. Push Data to firebase with security settings mentioned above (i.e. $uid === auth.uid)
  3. Validate pushed data
  4. Link twitter account to google account
  5. Push data to same firebase ref
  6. Validate data

Can you guys get me some sample code to look at to help debug this?

I was able to repro this with help from the discussion here:

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/firebase-talk/8UJISRriQjE/nRDbjkJNAgAJ

There seems to be an odd minification issue going on.

Was this page helpful?
0 / 5 - 0 ratings