- What problems does playtini/auth-bundle solve?
- It packages the authentication plumbing most PHP applications end up rewriting: user lookup, credential verification, token issuance, and route protection behind a single, consistent API. Instead of wiring those pieces together yourself, you drop it into an existing project and configure your user provider and token settings. It is a Symfony bundle from Playtini, so integration happens through Symfony configuration rather than a hand-written login controller.
- How do I install playtini/auth-bundle with Composer?
- Install it with Composer by requiring playtini/auth-bundle, then enable the bundle in your Symfony application's bundle registration. Confirm the supported PHP and Symfony versions in the package's composer.json on Packagist before upgrading a production project. After installation, add the bundle configuration for your user provider and token settings.
- Does playtini/auth-bundle work with Laravel, or is it Symfony-only?
- It is a Symfony bundle, not a Laravel package, so it does not register Laravel service providers, guards, or Artisan commands. Laravel developers evaluating it should treat it as a reference for the same concepts (user providers, token auth, route guards) rather than a drop-in dependency. For Laravel applications, the built-in authentication scaffolding plus Sanctum or Passport remains the idiomatic choice.
- How do I configure a user provider in playtini/auth-bundle?
- A user provider tells the bundle how to look up users and verify their credentials, and it is configured in the bundle's configuration section of your Symfony project. Point it at your user class or repository and make sure credential validation matches how your passwords are hashed. If your users live somewhere unusual, implement the bundle's extensible interfaces instead of bending the default provider.
- How does token-based authentication work in playtini/auth-bundle?
- Token-based authentication lets stateless API clients authenticate by presenting a token instead of a session cookie. The bundle issues a token after successful credential verification, and token-related behaviour is controlled through the token settings in the bundle configuration. Because the flow is stateless, it fits API endpoints and service-to-service calls better than traditional session login.
- How do I protect routes with the bundle's guards and middleware?
- The bundle provides guards and middleware for protecting routes, so you declare which routes require authentication in your routing or security configuration and let the guard reject unauthenticated requests. Keep protected routes grouped so the rules stay readable, and verify that guard order does not conflict with your other listeners. Token-protected API routes and session-protected web routes can run side by side.
- Can I use a custom storage backend with playtini/auth-bundle?
- Yes. The bundle exposes extensible interfaces for custom storage backends, so you can implement your own user lookup or token persistence instead of relying on the defaults. That is the intended path when users live in a legacy database, an external identity service, or a non-standard schema. Implement the interface, register it as a service, and wire it into the provider configuration.
- What is the minimum configuration for a working login flow?
- In most projects the minimum is installing the bundle, defining one user provider, and setting your token options, since sensible defaults cover the rest. Once those are in place, login verifies credentials, issues a token, and the guards protect the routes you select. Start from the smallest configuration that works in staging before adding custom interfaces or backends.
- Is playtini/auth-bundle production-ready and actively maintained?
- The bundle is designed to drop into existing projects with sensible defaults, but production readiness depends on your PHP and Symfony versions and on how actively the repository is maintained. Check the repository's commit history, tagged releases, and open issues before committing to it. Write integration tests covering login, token issuance, and route protection in your own application, and pin a specific version in composer.json so upgrades stay predictable.
- What alternatives to playtini/auth-bundle should I consider?
- For Symfony projects, the native Security component already handles user providers, authentication, and access control, while bundles such as LexikJWTAuthenticationBundle cover JWT tokens specifically. On the Laravel side, the equivalent ground is covered by Laravel's built-in authentication, Sanctum for API tokens, and Passport for full OAuth2. Compare playtini/auth-bundle on configuration overhead, maintenance activity, and how much custom storage logic you genuinely need.