PHPackages                             garlic/auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. garlic/auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

garlic/auth
===========

JWT token authorization for Garlic services

1.1.2(6y ago)03.4k1MITPHP

Since Jan 16Pushed 6y ago7 watchersCompare

[ Source](https://github.com/garlicservices/auth-bundle)[ Packagist](https://packagist.org/packages/garlic/auth)[ RSS](/packages/garlic-auth/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Garlic Authorization bundle
===========================

[](#garlic-authorization-bundle)

JWT token authorization bundle
------------------------------

[](#jwt-token-authorization-bundle)

### Installation

[](#installation)

#### 1. Run:

[](#1-run)

```
$ composer require garlic/auth
```

#### 2. Add to .env.dist (.env):

[](#2-add-to-envdist-env)

```
# Required
JWT_PUBLIC_KEY_PATH='config/jwt/public.pem'

# Optional
JWT_PRIVATE_KEY_PATH=''
JWT_KEY_PASS_PHRASE='passPhrase'
JWT_TOKEN_TTL='3600'
JWT_USER_IDENTITY_FIELD='email'
JWT_USER_CLASS='Garlic\Auth\Security\User'

# User auth settings
USER_ADMIN_USERNAME=admin
USER_ADMIN_PASSWORD=securePassword
USER_SERVICE_NAME=users
```

#### 3. Add Security configuration (change packages/security.yml):

[](#3-add-security-configuration-change-packagessecurityyml)

```
security:
    providers:
        jwt_provider:
            lexik_jwt:
                class: Garlic\Auth\Security\User
    firewalls:
        main:
            pattern:   ^/
            stateless: true
            anonymous: true
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator
```

#### 4. Add Lexik jwt bundle configuration (change lexik\_jwt\_authentication.yml):

[](#4-add-lexik-jwt-bundle-configuration-change-lexik_jwt_authenticationyml)

```
lexik_jwt_authentication:
    private_key_path: '%kernel.project_dir%/%env(JWT_PRIVATE_KEY_PATH)%'
    public_key_path:  '%kernel.project_dir%/%env(JWT_PUBLIC_KEY_PATH)%'
    pass_phrase:      '%env(JWT_PASSPHRASE)%'
    token_ttl:        '%env(JWT_TOKEN_TTL)%'
    user_identity_field: email
    encoder:
        service: lexik_jwt_authentication.encoder.lcobucci
        crypto_engine:  openssl
        signature_algorithm: RS384
    token_extractors:
        authorization_header:
            enabled: true
            prefix:  ''
            name:    Authorization
```

### Using

[](#using)

#### 1. Make JWT token from the authorization service

[](#1-make-jwt-token-from-the-authorization-service)

#### 2. Add JWT token to to request headers:

[](#2-add-jwt-token-to-to-request-headers)

Example:

```
Authorization: Body.Of.Token
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Recently: every ~132 days

Total

7

Last Release

2553d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8392050?v=4)[garlic](/maintainers/garlic)[@Garlic](https://github.com/Garlic)

---

Top Contributors

[![imaximius](https://avatars.githubusercontent.com/u/5578878?v=4)](https://github.com/imaximius "imaximius (1 commits)")

---

Tags

composer-packagesymfony-bundle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/garlic-auth/health.svg)

```
[![Health](https://phpackages.com/badges/garlic-auth/health.svg)](https://phpackages.com/packages/garlic-auth)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k50.9M364](/packages/tymon-jwt-auth)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70817.2M40](/packages/gesdinet-jwt-refresh-token-bundle)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

83910.6M60](/packages/php-open-source-saver-jwt-auth)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

585665.9k1](/packages/scheb-2fa)[drenso/symfony-oidc-bundle

OpenID connect bundle for Symfony

95714.0k3](/packages/drenso-symfony-oidc-bundle)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1152.7M11](/packages/patrickbussmann-oauth2-apple)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
