You must use App Services in the context of a user. Users are associated with one or more authentication providers. You can also assign data access rules to users to constrain what data they access. Use Realm Web SDK to perform the following authentication and user management actions:
Creation of new user accounts
Inicio de sesión y cierre de sesión de usuario
Multiple users logged on at the same time on the same device
Linking user accounts from different providers
Proporcionar datos de usuario personalizados
When you have a logged-in user, SDK methods enable you to:
Run a backend function as the logged-in user
Create and Delete Users
For all authentication providers other than email/password authentication, App Services automatically creates a user the first time a user authenticates. If a user authenticates via more than one method, you can link these user identities to a single user.
You can delete users. Deleting a user deletes metadata attached to the user, but does not delete user-created data from the backend.
Conectar y desconectar usuarios
Utilice uno o más Proveedores de autenticación para iniciar y cerrar sesión de usuarios en tu aplicación cliente. Puedes:
Permitir que los usuarios inicien sesión con una cuenta social existente, como Apple, Facebook o Google.
Create new user accounts with App Services email/password management, your own custom function, or custom JWT user management.
Enable anonymous users to let users access your App Services App without persisting user data.
For further information, see Authenticate Users.
Sesiones de usuario
App Services manages sessions with access tokens and refresh tokens. Client SDKs supply the logic to manage tokens and provide them with requests.
Realm uses refresh tokens to automatically update a user's access token when it expires. However, Realm does not automatically refresh the refresh token. When the refresh token expires, the SDK can no longer get an updated access token and the device cannot sync until the user logs in again.
Para obtener más información sobre la gestión de sesiones de usuario y tokens, consulta Sesiones de usuario en la documentación de Servicios de aplicación.
The Web SDK stores these tokens in the browser storage.
Read and Update Custom User Data
Puedes asociar datos personalizados a un usuario, como su idioma preferido o zona horaria local, y leerlos desde tu aplicación cliente. Un usuario tiene un customData propiedad que puede utilizar para acceder a datos de usuario personalizados.
Para crear y actualizar datos de usuario personalizados, debe acceder directamente a su fuente de datos MongoDB.