1

For some applications my team creates authenticated users with a password/email combination. This will get the user an firebase user uid. The problem with this is that the keys in firebase itself are external id's, and they do not match the auth.uid. How would I go about creating security rules then? Sample auth.uid:

9dkad6c7-s649-9623-99e2-5a0dbgf5dfdz

Then a sample of the structure:

database
         |
     —— conversations
                           |
              ——{external id 1}
              |     |
              |     ——{external id 2}
              |             |
              |             {data here}
              |
            messages
              |
               ——{externalid1|externalid2}
              |         |
              |         —{-KFasdahsduids}
              |                 |
              |                    {data here}
              |
              |
            users
             |
             ——{externalId}
            |      |
            |   {first name}
            |   {last name}
            |   {firebaseUID}
            |   {more data here}
            |
            ——{externalId2}
                |
                {first name}
                {lastname}
                {firebaseUID}
                {more data here}

The problem really is that the auth.uid is not the same as the external ones, and we really need those external id's. Can I do something with the UID that is stored in the /users/? Any suggestions?

dnsko
  • 1,017
  • 4
  • 17
  • 29
  • 2
    Use the firebase id in your data structure and add a node were you make the connection between the firebase id and the external id. Something like [this](http://stackoverflow.com/questions/15148089/how-can-i-login-with-multiple-social-services-with-firebase) should give an idea of what i'm talking about. – André Kool May 04 '16 at 08:40
  • After having done some research into it, this looks like the best option indeed. Thanks – dnsko May 05 '16 at 14:20

0 Answers0