AuthServiceProvider class

Enhanced Authentication Service Provider

This service provider registers all authentication-related services and dependencies in the container. It follows the Dependency Injection pattern and ensures proper service registration and configuration.

Services registered:

  • AuthConfig: Configuration access
  • AuthRepository: Data access layer
  • PasswordVerifier: Password hashing and verification
  • TokenGenerator: Secure token generation
  • AuthManager: Main authentication facade
  • Individual auth drivers (JWT, Token)

Example usage:

// In application bootstrap
final container = Container();
final authProvider = AuthServiceProvider();
await authProvider.register(container);
await authProvider.boot(container);

// Later in the application
final authManager = container.make<AuthManager>();
final jwtService = authManager.driver('jwt');
Inheritance

Constructors

AuthServiceProvider()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isDeferred → bool
If true, the provider is deferred and only loaded when its services are requested.
no setteroverride
provides → List<Type>
The services provided by this provider.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

boot(ContainerInterface container) → Future<void>
Boots the authentication services
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(ContainerInterface container) → void
Registers authentication services in the container
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited