Most applications need to know the identity of a user. Knowing a user's identity allows an app to provide a customized experience and grant them permissions to access their data. The process of proving a user's identity is called authentication. Firebase provides a full set of authentication options out-of-the-box.
When a user authenticates to a Firebase app, three things happen:
- Information about the user is returned in callbacks on the client device. This allows you to customize your app's user experience for that specific user.
- The user information returned contains a
uid
(a unique ID), which is guaranteed to be distinct across all providers, and to never change for a specific authenticated user. - The value of the
auth
variable in your app's Security and Firebase Rules becomes defined. This variable isnull
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. This allows you to securely control data access on a per-user basis.