The Anonymous authentication provider allows users to log in to your application without providing credentials. Each time someone authenticates anonymously, the provider generates a new anonymous user object for that session. Anonymous user objects have a unique ID value but no other metadata fields or configuration options.
Potential use cases for anonymous authentication include:
- Authenticating the readers of a blog or news service.
- Allowing end users to try the features of an application before registering for an account.
- Simplifying the creation of users while developing and testing the client application.
An Anonymous user object is not intended to be reused, and once a user logs out, they will not be able to retrieve any previous user data. To persist data associated with an Anonymous user, you can associate that existing Anonymous identity with a user account created by a different authentication provider.
Realm may delete an Anonymous user object that is 90 days old (or older). When an account is deleted, it is not recoverable and any associated user data is lost. Documents created or modified by the user remain unaffected.
The anonymous authentication provider does not have any provider-specific configuration options.
For code examples that demonstrate how to register and log in using anonymous authentication, see the documentation for the Realm SDKs:
- Anonymous authentication allows users to interact with your application creating an identity.
- To persist data from an anonymous session after a user creates an identity with a different authentication provider, you can link the two identities.