Symfony
sponsored by SensioLabs
Menu
  • About
  • Documentation
  • Screencasts
  • Cloud
  • Certification
  • Community
  • Businesses
  • News
  • Download
  1. Home
  2. Documentation
  3. Components
  4. The Security Component
  • Documentation
  • Book
  • Reference
  • Bundles
  • Cloud
Search by Algolia

Table of Contents

  • Installation
  • Learn More

The Security Component

Edit this page

Warning: You are browsing the documentation for Symfony 3.0, which is no longer maintained.

Read the updated version of this page for Symfony 6.2 (the current stable version).

The Security Component

The Security component provides a complete security system for your web application. It ships with facilities for authenticating using HTTP basic or digest authentication, interactive form login or X.509 certificate login, but also allows you to implement your own authentication strategies. Furthermore, the component provides ways to authorize authenticated users based on their roles, and it contains an advanced ACL system.

Installation

You can install the component in 2 different ways:

  • Install it via Composer (symfony/security on Packagist);
  • Use the official Git repository (https://github.com/symfony/security).

Then, require the vendor/autoload.php file to enable the autoloading mechanism provided by Composer. Otherwise, your application won't be able to find the classes of this Symfony component.

The Security component is divided into four smaller sub-components which can be used separately:

symfony/security-core
It provides all the common security features, from authentication to authorization and from encoding passwords to loading users.
symfony/security-http
It integrates the core sub-component with the HTTP protocol to handle HTTP requests and responses.
symfony/security-csrf
It provides protection against CSRF attacks.
symfony/security-acl
It provides a fine grained permissions mechanism based on Access Control Lists.

Learn More

  • Authentication
  • Authorization
  • The Firewall and Authorization
  • Securely Generating Random Values
  • Security
  • How Does the Security access_control Work?
  • How to Use Access Control Lists (ACLs)
  • How to Use advanced ACL Concepts
  • How to Authenticate Users with API Keys
  • Using CSRF Protection in the Login Form
  • How to Create a custom Authentication Provider
  • How to Create a Custom Form Password Authenticator
  • How to Create a custom User Provider
  • How to Load Security Users from the Database (the Entity Provider)
  • How to Restrict Firewalls to a Specific Request
  • How to Force HTTPS or HTTP for different URLs
  • How to Customize your Form Login
  • How to Build a Traditional Login Form
  • How to Create a Custom Authentication System with Guard
  • How to Restrict Firewalls to a Specific Host
  • How to Impersonate a User
  • Authenticating against an LDAP server
  • How to Use Multiple Guard Authenticators
  • How to Use multiple User Providers
  • How to Choose the Password Encoder Algorithm Dynamically
  • How to Manually Encode a Password
  • Using pre Authenticated Security Firewalls
  • How to Add "Remember Me" Login Functionality
  • How to Secure any Service or Method in your Application
  • How to Check for Known Security Vulnerabilities in Your Dependencies
  • How to Change the default Target Path Behavior
  • How to Create and Enable Custom User Checkers
  • How to Use Voters to Check User Permissions
  • SecurityBundle Configuration ("security")
  • UserPassword
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
We stand with Ukraine.
Version:
Show your Symfony expertise

Show your Symfony expertise

Code consumes server resources. Blackfire tells you how

Code consumes server resources. Blackfire tells you how

↓ Our footer now uses the colors of the Ukrainian flag because Symfony stands with the people of Ukraine.

Avatar of Mohamed Ettaki TALBI, a Symfony contributor

Thanks Mohamed Ettaki TALBI (@takman) for being a Symfony contributor

5 commits • 29 lines changed

View all contributors that help us make Symfony

Become a Symfony contributor

Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

Learn how to contribute

Symfony™ is a trademark of Symfony SAS. All rights reserved.

  • What is Symfony?
    • Symfony at a Glance
    • Symfony Components
    • Case Studies
    • Symfony Releases
    • Security Policy
    • Logo & Screenshots
    • Trademark & Licenses
    • symfony1 Legacy
  • Learn Symfony
    • Symfony Docs
    • Symfony Book
    • Reference
    • Bundles
    • Best Practices
    • Training
    • eLearning Platform
    • Certification
  • Screencasts
    • Learn Symfony
    • Learn PHP
    • Learn JavaScript
    • Learn Drupal
    • Learn RESTful APIs
  • Community
    • SymfonyConnect
    • Support
    • How to be Involved
    • Code of Conduct
    • Events & Meetups
    • Projects using Symfony
    • Downloads Stats
    • Contributors
    • Backers
  • Blog
    • Events & Meetups
    • A week of symfony
    • Case studies
    • Cloud
    • Community
    • Conferences
    • Diversity
    • Documentation
    • Living on the edge
    • Releases
    • Security Advisories
    • SymfonyInsight
    • Twig
    • SensioLabs
  • Services
    • SensioLabs services
    • Train developers
    • Manage your project quality
    • Improve your project performance
    • Host Symfony projects
    Deployed on
Follow Symfony
Search by Algolia