initializeAuthServices method
- required List<
TokenManagerBuilder< tokenManagerBuilders,TokenManager> > - List<
IdentityProviderBuilder< identityProviderBuilders = const [],Object> > - AuthUsersConfig authUsersConfig = const AuthUsersConfig(),
- UserProfileConfig userProfileConfig = const UserProfileConfig(),
Creates a new AuthServices instance and sets it as the global instance.
tokenManagerBuilders is the list of token manager builders. The first in
the list will be used as the primary token manager, and the others as
additional token managers.
identityProviderBuilders is a list of IdentityProviderBuilder that
build the identity providers used by authentication endpoints. Each one
creates a provider instance with the appropriate token manager dependency.
authUsersConfig is the configuration for the auth users manager that
will be used to create the auth users manager.
userProfileConfig is the configuration for the user profiles manager
that will be used to create the user profiles manager.
These are passed to the AuthServices constructor to create the instance.
Implementation
void initializeAuthServices({
required final List<TokenManagerBuilder> tokenManagerBuilders,
final List<IdentityProviderBuilder> identityProviderBuilders = const [],
final AuthUsersConfig authUsersConfig = const AuthUsersConfig(),
final UserProfileConfig userProfileConfig = const UserProfileConfig(),
}) {
AuthServices.set(
tokenManagerBuilders: tokenManagerBuilders,
identityProviderBuilders: identityProviderBuilders,
authUsersConfig: authUsersConfig,
userProfileConfig: userProfileConfig,
);
authenticationHandler = AuthServices.instance.authenticationHandler;
}