# symfony/security-http

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/symfony-security-http).**

1,712 stars · 23 forks · PHP · MIT

## Links

- GitHub: https://github.com/symfony/security-http
- Homepage: https://symfony.com/security
- awesome-repositories: https://awesome-repositories.com/repository/symfony-security-http.md

## Topics

`component` `php` `symfony` `symfony-component`

## Description

This project provides a comprehensive security framework for PHP applications, designed to manage the entire lifecycle of user authentication and authorization. It functions as a middleware layer that intercepts incoming HTTP requests to enforce security policies, resolve user identities, and maintain persistent sessions across web interactions.

The framework distinguishes itself through a modular, event-driven architecture that integrates directly into the application lifecycle. It supports diverse authentication methods, including standard form-based logins, API bearer tokens, and federated identity integration via OpenID Connect and OAuth. Authorization is handled through a flexible system that combines role-based access control with attribute-driven metadata, allowing developers to define granular permissions and custom logic directly on controller methods.

Beyond core identity management, the library includes protective utilities to mitigate common web vulnerabilities. It provides built-in mechanisms for cross-site request forgery protection, login rate limiting to prevent brute-force attacks, and secure session termination directives. The framework also facilitates automated security auditing by scanning project dependencies for known vulnerabilities.

## Tags

### Security & Cryptography

- [Authentication Frameworks](https://awesome-repositories.com/f/security-cryptography/authentication-frameworks.md) — Serves as a comprehensive PHP framework for managing user authentication, session lifecycles, and access control across web applications.
- [User Authentication Systems](https://awesome-repositories.com/f/security-cryptography/user-authentication-systems.md) — Provides a comprehensive framework for verifying visitor credentials and establishing secure sessions. ([source](https://symfony.com/doc/current/components/security.html))
- [Bearer Token Authentication](https://awesome-repositories.com/f/security-cryptography/bearer-token-authentication.md) — Validates incoming requests by extracting and verifying bearer tokens from headers or request bodies. ([source](https://github.com/symfony/security-http/tree/8.2/AccessToken))
- [Route-Based](https://awesome-repositories.com/f/security-cryptography/firewalls/route-based.md) — Configures firewalls to intercept incoming HTTP requests and enforce security policies across specific routes. ([source](https://github.com/symfony/security-http#readme))
- [Role-Based Access Control](https://awesome-repositories.com/f/security-cryptography/role-based-access-control.md) — Enforces authorization rules based on user roles, supporting hierarchical structures and granular checks. ([source](https://symfony.com/doc/current/components/security.html))
- [Backend Security Middleware](https://awesome-repositories.com/f/security-cryptography/security/application-and-web/web-application/backend-security-middleware.md) — Functions as a middleware layer that intercepts incoming HTTP requests to enforce security policies and restrict access to application routes.
- [Web Application Security](https://awesome-repositories.com/f/security-cryptography/web-application-security.md) — Implements a comprehensive security framework for web applications, managing authentication, session persistence, and request interception.
- [Attribute-Based Access Control](https://awesome-repositories.com/f/security-cryptography/attribute-based-access-control.md) — Enforces granular authorization rules on controller methods using declarative metadata attributes.
- [Brute Force Protections](https://awesome-repositories.com/f/security-cryptography/brute-force-protections.md) — Provides built-in rate-limiting mechanisms to throttle login attempts and prevent brute-force attacks on application endpoints.
- [Authentication Rate Limiters](https://awesome-repositories.com/f/security-cryptography/brute-force-protections/challenge-attempt-limiters/authentication-rate-limiters.md) — Limits the frequency of login attempts to prevent brute-force attacks against user accounts. ([source](https://symfony.com/doc/current/components/security.html))
- [Cross-Site Request Forgery Protections](https://awesome-repositories.com/f/security-cryptography/cross-site-request-forgery-protections.md) — Protects against cross-site request forgery by verifying security tokens provided in headers, query strings, or request bodies. ([source](https://github.com/symfony/security-http/blob/8.2/CHANGELOG.md))
- [Custom Authorization Logic](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies/authorization-and-user-administration/access-control-authorization/custom-authorization-logic.md) — Defines complex business logic for access control by creating custom evaluators beyond simple role-based rules. ([source](https://symfony.com/doc/current/components/security.html))
- [OIDC Identity Integrations](https://awesome-repositories.com/f/security-cryptography/oidc-identity-integrations.md) — Verifies external identity tokens by checking digital signatures and claims to authenticate users through third-party providers. ([source](https://github.com/symfony/security-http/blob/8.2/CHANGELOG.md))
- [Password Hashing Utilities](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/password-hashing-utilities.md) — Secures user credentials by hashing passwords before storage and verifying them during login attempts. ([source](https://symfony.com/doc/current/components/security.html))
- [Session Cookie Authentications](https://awesome-repositories.com/f/security-cryptography/session-cookie-handlers/cookie-based-authentication-bridges/session-cookie-authentications.md) — Maintains user authentication across browser sessions by managing secure cookies and user identifiers. ([source](https://github.com/symfony/security-http/blob/8.2/CHANGELOG.md))
- [Third-Party Identity Integrations](https://awesome-repositories.com/f/security-cryptography/third-party-identity-integrations.md) — Supports federated identity integration via OpenID Connect and OAuth to authenticate users through external providers.
- [Session Token Persisters](https://awesome-repositories.com/f/security-cryptography/token-authentication/persistent-token-authenticators/local-storage-token-persisters/session-token-persisters.md) — Maintains user sessions by serializing and deserializing security tokens across multiple web requests.
- [User Providers](https://awesome-repositories.com/f/security-cryptography/user-authentications/user-providers.md) — Abstracts the retrieval of user identity objects from various storage backends.
- [User Identity Management](https://awesome-repositories.com/f/security-cryptography/user-identity-management.md) — Loads and refreshes user objects from storage providers to ensure session data remains synchronized. ([source](https://symfony.com/doc/current/components/security.html))

### Software Engineering & Architecture

- [Firewall Interceptors](https://awesome-repositories.com/f/software-engineering-architecture/request-interception-middleware/firewall-interceptors.md) — Intercepts incoming HTTP traffic at the application entry point to enforce security policies and route requests.
- [Authentication Event Hooks](https://awesome-repositories.com/f/software-engineering-architecture/event-interception/authentication-event-hooks.md) — Processes authentication through a chain of event-driven listeners during the request lifecycle.

### Artificial Intelligence & ML

- [Authenticated User Injection](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/agent-orchestration-multi-agent/security-and-auth/authentication-strategies/request-handling/authenticated-user-injection.md) — Resolves the currently authenticated user object from the security context and passes it into controller methods. ([source](https://github.com/symfony/security-http/tree/8.2/Controller))
- [Dependency-Injected Contexts](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/agent-orchestration-multi-agent/security-and-auth/authentication-strategies/request-handling/authenticated-user-injection/dependency-injected-contexts.md) — Simplifies access to authenticated user data by injecting the security context directly into controller methods.
