providers/anonymous library

This library contains the Anonymous authentication provider for the Serverpod Idp module.

Classes

AnonymousAccount
A shell account. Persists as long as the user remains logged in, but can never restore this session if the user logs out or loses access to their device.
AnonymousIdp
Main class for the anonymous identity provider. The methods defined here are intended to be called from an endpoint.
AnonymousIdpAccountCreationResult
The result of the AnonymousIdpAccountCreationUtil.createAnonymousAccount operation.
AnonymousIdpBaseEndpoint
Base endpoint for anonymous accounts.
AnonymousIdpConfig
Configuration for the anonymous identity provider.
AnonymousIdpUtils
Anonymous account management functions.
AuthSuccess
Response model representing a successful authentication result with all relevant authentication information.

Enums

AnonymousAccountBlockedExceptionReason
The reason an anonymous account creation was blocked.

Extensions

AnonymousIdpGetter on AuthServices
Extension to get the EmailIdp instance from the AuthServices.

Typedefs

AfterAnonymousAccountCreatedFunction = FutureOr<void> Function(Session session, {required UuidValue authUserId, required Transaction? transaction})
Function to be called after a new anonymous account has been created.
BeforeAnonymousAccountCreatedFunction = FutureOr<void> Function(Session session, {String? token, required Transaction? transaction})
Function to be called before a new anonymous account is created. This function should throw an exception if a new anonymous account is not allowed to be created for any reason, or return void otherwise. This mechanism is how an application would prevent abuse of the anonymous account creation process.

Exceptions / Errors

AnonymousAccountBlockedException
Exception to be thrown if anonymous account creation fails.