简体   繁体   中英

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

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.

{
  "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, etc, I think this is good for security purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM