PHPackages                             symfony/security-core - 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. [Security](/categories/security)
4. /
5. symfony/security-core

ActiveLibrary[Security](/categories/security)

symfony/security-core
=====================

Symfony Security Component - Core Library

v8.1.2(4w ago)1.9k219.0M↓19.9%3520MITPHPPHP &gt;=8.4.1

Since Oct 7Pushed 4d ago8 watchersCompare

[ Source](https://github.com/symfony/security-core)[ Packagist](https://packagist.org/packages/symfony/security-core)[ Docs](https://symfony.com)[ Fund](https://symfony.com/sponsor)[ GitHub Sponsors](https://github.com/fabpot)[ RSS](/packages/symfony-security-core/feed)WikiDiscussions 8.2 Synced 2w ago

READMEChangelog (10)Dependencies (93)Versions (654)Used By (20)Security (5)

Security Component - Core
=========================

[](#security-component---core)

Security provides an infrastructure for sophisticated authorization systems, which makes it possible to easily separate the actual authorization logic from so called user providers that hold the users credentials.

Getting Started
---------------

[](#getting-started)

```
composer require symfony/security-core
```

```
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\Security\Core\Authorization\Voter\RoleVoter;
use Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Role\RoleHierarchy;

$accessDecisionManager = new AccessDecisionManager([
    new AuthenticatedVoter(new AuthenticationTrustResolver()),
    new RoleVoter(),
    new RoleHierarchyVoter(new RoleHierarchy([
        'ROLE_ADMIN' => ['ROLE_USER'],
    ]))
]);

$user = new \App\Entity\User(...);
$token = new UsernamePasswordToken($user, 'main', $user->getRoles());

if (!$accessDecisionManager->decide($token, ['ROLE_ADMIN'])) {
    throw new AccessDeniedException();
}
```

Sponsor
-------

[](#sponsor)

The Security component for Symfony 8.1 is [backed](https://symfony.com/backers) by [SymfonyCasts](https://symfonycasts.com).

Learn Symfony faster by watching real projects being built and actively coding along with them. SymfonyCasts bridges that learning gap, bringing you video tutorials and coding challenges. Code on!

Help Symfony by [sponsoring](https://symfony.com/sponsor) its development!

Resources
---------

[](#resources)

- [Documentation](https://symfony.com/doc/current/components/security.html)
- [Contributing](https://symfony.com/doc/current/contributing/index.html)
- [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls)in the [main Symfony repository](https://github.com/symfony/symfony)

###  Health Score

86

—

ExcellentBetter than 100% of packages

Maintenance97

Actively maintained with recent releases

Popularity79

Solid adoption and visibility

Community54

Growing community involvement

Maturity100

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~7 days

Recently: every ~1 days

Total

654

Last Release

24d ago

Major Versions

v7.4.13 → v8.0.132026-05-23

v6.4.42 → v7.4.142026-06-09

v7.4.14 → v8.0.142026-06-09

v6.4.43 → v7.4.152026-07-19

7.4.x-dev → 8.0.x-dev2026-07-19

PHP version history (14 changes)v2.4.0-BETA1PHP &gt;=5.3.3

v2.7.0-BETA1PHP &gt;=5.3.9

v3.0.0-BETA1PHP &gt;=5.5.9

v3.3.7PHP ^5.5.9|&gt;=7.0.8

v4.0.0-BETA1PHP ^7.1.3

v5.0.0-RC1PHP ^7.2.9

v5.0.1PHP ^7.2.5

v5.1.0-RC2PHP &gt;=7.2.5

v4.4.10PHP &gt;=7.1.3

v6.0.0-BETA1PHP &gt;=8.0.2

v6.1.0-BETA1PHP &gt;=8.1

v7.0.0-BETA1PHP &gt;=8.2

v8.0.0-RC1PHP &gt;=8.4

v8.1.0-BETA1PHP &gt;=8.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

---

Top Contributors

[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (939 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (667 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (199 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (183 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (61 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (57 commits)")[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (23 commits)")[![jderusse](https://avatars.githubusercontent.com/u/578547?v=4)](https://github.com/jderusse "jderusse (22 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (17 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (15 commits)")[![webmozart](https://avatars.githubusercontent.com/u/176399?v=4)](https://github.com/webmozart "webmozart (14 commits)")[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (14 commits)")[![fancyweb](https://avatars.githubusercontent.com/u/3658119?v=4)](https://github.com/fancyweb "fancyweb (13 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (12 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (11 commits)")[![javiereguiluz](https://avatars.githubusercontent.com/u/73419?v=4)](https://github.com/javiereguiluz "javiereguiluz (8 commits)")[![weaverryan](https://avatars.githubusercontent.com/u/121003?v=4)](https://github.com/weaverryan "weaverryan (7 commits)")[![csarrazi](https://avatars.githubusercontent.com/u/465798?v=4)](https://github.com/csarrazi "csarrazi (7 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (6 commits)")[![saro0h](https://avatars.githubusercontent.com/u/667519?v=4)](https://github.com/saro0h "saro0h (6 commits)")

---

Tags

componentphpsymfonysymfony-component

### Embed Badge

![Health badge](/badges/symfony-security-core/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-security-core/health.svg)](https://phpackages.com/packages/symfony-security-core)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k190.0M2.6k](/packages/symfony-security-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M236](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.2B15.1k](/packages/symfony-console)[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k464.3M10.6k](/packages/symfony-dependency-injection)

PHPackages © 2026

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