Skip to content

About

A comprehensive Symfony authentication and authorization bundle with JWT, OpenID Connect, user management, audit logging, and subscription management

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

2 Commits

Folders and files

Repository files navigation

AuthXBundle

Pepprio Logo

A comprehensive Symfony authentication bundle with JWT, OpenID Connect, and advanced user management

Latest Stable Version Total Downloads License PHP Version Symfony Version

CI Coverage Status Quality Score PHPStan

πŸš€ Features

  • πŸ” JWT Authentication: First-party JWT implementation with RS256 signing
  • 🌐 OpenID Connect Provider: Full OIDC support with Authorization Code + PKCE flow
  • πŸ‘₯ User Management: Complete CRUD operations with role-based access control
  • πŸ“Š Audit System: Track all entity changes with old/new data comparison
  • πŸ’³ Subscription Management: Built-in subscription and billing support
  • πŸ”‘ Advanced Security: Rate limiting, brute force protection, 2FA support
  • 🎨 Customizable Templates: Overridable Twig templates and services
  • πŸ› οΈ Developer Experience: Maker commands for easy setup and management
  • πŸ“§ Email Integration: Password reset, verification, and notification emails
  • 🌍 Internationalization: Multi-language support with translation files

πŸ“‹ Requirements

Component Version
PHP >= 7.4 (7.3+ for legacy versions)
Symfony >= 6.4
Doctrine ORM >= 2.5
OpenSSL Required for JWT signing

Supported Versions

PHP Versions

  • ⚠️ PHP 7.3 (legacy support only)
  • βœ… PHP 7.4
  • βœ… PHP 8.0
  • βœ… PHP 8.1
  • βœ… PHP 8.2
  • βœ… PHP 8.3

Symfony Versions

  • βœ… Symfony 6.4 LTS
  • βœ… Symfony 7.0
  • βœ… Symfony 7.1
  • βœ… Symfony 7.2

πŸ“¦ Installation

1. Install via Composer

composer require pepprio/authx-bundle

2. Enable the Bundle

Add the bundle to your config/bundles.php:

<?php

return [
    // ... other bundles
    Pepprio\AuthXBundle\AuthXBundle::class => ['all' => true],
];

3. Run the Installation Command

php bin/console authx:install

This command will:

  • Generate JWT keys
  • Create configuration files
  • Set up database migrations
  • Configure security settings

4. Run Migrations

php bin/console doctrine:migrations:migrate

⚑ Quick Start

Basic Configuration

Create config/packages/authx.yaml:

authx:
  jwt:
    ttl: 3600
    algorithm: 'RS256'
    issuer: 'your-app'
  
  oidc:
    enabled: true
    issuer_url: 'https://your-domain.com'
  
  security:
    password_policy:
      min_length: 8
      require_uppercase: true
      require_lowercase: true
      require_numbers: true
      require_special_chars: true
    
    rate_limiting:
      login_attempts: 5
      lockout_duration: 900

Security Configuration

Update your config/packages/security.yaml:

security:
  providers:
    authx_user_provider:
      id: Pepprio\AuthXBundle\Security\UserProvider
  
  firewalls:
    api:
      pattern: ^/api
      stateless: true
      jwt: ~
    
    main:
      lazy: true
      provider: authx_user_provider
      form_login:
        login_path: authx_login
        check_path: authx_login_check
      logout:
        path: authx_logout

Create Your First User

php bin/console authx:user:create [email protected] --admin

Generate API Client

php bin/console authx:client:create "My App" --redirect-uri="https://myapp.com/callback"

πŸ“š Documentation

Online Documentation

Visit our comprehensive documentation site: https://pepprio.github.io/authx-bundle

πŸ”§ CLI Commands

Command Description
authx:install Bootstrap the bundle configuration
authx:user:create Create a new user
authx:user:promote Promote user to admin
authx:client:create Create OAuth2/OIDC client
authx:jwk:generate Generate new JWT signing keys
authx:jwk:rotate Rotate JWT keys
authx:token:revoke Revoke access tokens
authx:audit:cleanup Clean up old audit records

πŸ§ͺ Testing

Run Tests

# Run all tests
composer test

# Run specific test suites
composer test:unit
composer test:integration
composer test:functional

# Run with coverage
composer test:coverage

Code Quality

# PHP CodeSniffer
composer cs:check
composer cs:fix

# PHPStan
composer stan

# All quality checks
composer qa

πŸ”’ Security

AuthXBundle implements industry-standard security practices:

  • JWT with RS256: Asymmetric signing for enhanced security
  • PKCE: Proof Key for Code Exchange for OAuth2 flows
  • Rate Limiting: Protection against brute force attacks
  • CSRF Protection: Built-in CSRF token validation
  • XSS Prevention: Output escaping and CSP headers
  • Audit Logging: Complete audit trail of all changes

Security Vulnerabilities

If you discover a security vulnerability, please send an email to [email protected]. All security vulnerabilities will be promptly addressed.

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/pepprio/authx-bundle.git
cd authx-bundle

# Install dependencies
composer install

# Set up test environment
cp .env.test.dist .env.test

# Run tests
composer test

πŸ“„ License

This bundle is licensed under the MIT License. See the LICENSE file for details.

πŸ™ Credits

πŸ“ž Support


Made with ❀️ by Pepprio

About

A comprehensive Symfony authentication and authorization bundle with JWT, OpenID Connect, user management, audit logging, and subscription management

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages