Where does firebase save it's simple login users?

后端 未结 2 1319
北荒
北荒 2021-01-11 15:26

I am currently using firebase to make an ionic app. I am using firebase simple login for social auth (facebook, twi

2条回答
  •  梦毁少年i
    2021-01-11 15:38

    Firebase does not store profile or user state in your Firebase instance. To persist user data you must save it to your Firebase.

    Firebase provides multiple authentications services

    1. Using existing social login providers such Facebook, Twitter, Google, and GitHub. Using these services provides an option for your users to access your application without creating a new account.

    2. Using built-in support for logging in with email & password. This requires registration and account creation that is handled by Firebase. The user account information is stored outside you application.

    3. Using a custom authentication to implement existing server-side authentication, single sign-on, legacy systems, or third-party OAuth based services (such as Yahoo).

    Once authenticated, Firebase return a variable auth to your application that you can use for authorization and access control. This variable is null for unauthenticated users, but for authenticated users it is an object containing the user's unique (auth.uid) and potentially other data about the user.

    If you want to persist additional user information such as name and location, then you need to use auth.uid and store it in your Firebase with additional profile data.

    Internally, Firebase generates JSON Web Tokens (JWTs) and creates authenticated sessions by calling Firebase.loginWithCustomToken() with those tokens. Each user is assigned a uid (a unique ID), which is guaranteed to be distinct across all providers, and to never change for a specific authenticated user.

提交回复
热议问题