Albert
Albert

Reputation: 343

Firebase Authentication without Username and Password

I am using Firebase and I am Login with the FIREBASE_TOKEN and put in the Firebase Rules the following:

     {
      "rules": 
      {
      ".read": false,
      ".write": false,

      }
     }

So just the connections with the Token can read write in the Database. My purpose is to make it easy for the users to login , but I need to use another authentication maybe Unique phone ID so users will not able to read unless the UniqueId is presented in the Database? what's the best solution to do it? and if UniqueId how to register them in the rules? Thank you

Upvotes: 1

Views: 865

Answers (2)

Frank van Puffelen
Frank van Puffelen

Reputation: 598765

I'm not entirely sure what you're asking for. But if none of the existing identity providers satisfy your needs, you can create a custom provider and use that custom provider in your Android app. This will give you full control over how your user signs in and what information about the user is then available in the auth variable in the security rules.

Upvotes: 3

Dhaval Solanki
Dhaval Solanki

Reputation: 4705

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

Above rules define every one can access database who have authenticated any of the singed method which provide by google, Like using facebook, google, anonymous, e.t.c, I think this is good for security purpose.

Upvotes: 1

Related Questions