Search by

adachsoft / auth-symfony-bundle

Arkadiusz Adach

Symfony bundle with login, logout and current-account endpoints, bearer-token authentication of API requests and permission checks backed by adachsoft/auth-contracts and adachsoft/access-control-contracts.

Package info

gitlab.com/a.adach/auth-symfony-bundle

Issues

Type:symfony-bundle

pkg:composer/adachsoft/auth-symfony-bundle

Statistics

Installs: 19

Dependents: 0

Suggesters: 0

Stars: 0

v0.3.0 2026-11-17 13:00 UTC

This package is auto-updated.

Last update: 2026-11-17 12:02:06 UTC


README

adachsoft/auth-symfony-bundle adds authentication and permission-checking endpoints to a Symfony application. It provides password-based login and logout, current-account information, bearer-token authentication for API requests, and role-based permission checks backed by AdachSoft contracts.

Features

  • Login, logout, current-account, password-change, and permission-check endpoints.
  • Bearer-token authentication with sessions, long-lived API keys, and an optional bootstrap token.
  • API-key management endpoints and console commands, with role-based permissions and configurable protected/public routes.
  • Route-level permission checks and an access-checking service for application code.
  • User administration endpoints (list, create, change, remove) guarded by user.* permissions.
  • Console commands for managing accounts.
  • Replaceable storage and authentication collaborators.

Installation

composer require adachsoft/auth-symfony-bundle

Register the bundle in config/bundles.php:

return [
    // ...
    AdachSoft\AuthSymfonyBundle\AdachSoftAuthBundle::class => ['all' => true],
];

Import its routes in config/routes.yaml:

adachsoft_auth:
    resource: '@AdachSoftAuthBundle/Resources/config/routes.yaml'

The bundle uses JSON files for credentials, sessions, API-key metadata, accounts, and access-control definitions by default. Configure their locations, API-key policy, optional bootstrap token, and authentication policy in config/packages/adachsoft_auth.yaml. Keep authentication data outside the web root and out of version control.

Create an access-control definitions file and an initial user with the auth:user:create console command. The auth:api-key:create command displays a service key once; auth:api-key:list and auth:api-key:revoke provide recovery and key lifecycle management. See the reference and usage examples for configuration and protecting application routes.

Documentation

The bundle does not require symfony/security-bundle; it can be added without replacing an application's existing Symfony security configuration. API keys inherit their account's role permissions; use api_key.manage only for keys belonging to other accounts. Keep bootstrap tokens temporary and rotate or unset them after recovery.