Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

Symfony Security: The Basics

via SymfonyCasts

Overview

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates

Security is one of those things every app needs... but firewalls, authenticators, users, roles, voters and all the other pieces can feel like a lot. Let's make sense of it!

We'll start by getting a user logged in, then work our way through authentication, authorization and the tools Symfony gives us to secure a real application.

Here's what we'll tackle:

  • Installing and configuring Symfony's Security system
  • Creating the User class and loading users from the database
  • Building a login form and understanding password hashing
  • Accessing the logged-in user and adding login/logout links
  • Protecting logout with CSRF
  • Keeping users logged in with "remember me"
  • Authentication attributes like IS_AUTHENTICATED_FULLY
  • Roles, role hierarchy and access_control
  • Fetching the current user from controllers and services
  • Creating custom voters for object-level permissions
  • Impersonating users with switch_user and safely exiting impersonation
  • Limiting login attempts
  • Hooking into security events
  • Building a registration form

Along the way, we'll peek behind the scenes so you understand not just how to configure Symfony Security, but how all of these pieces fit together.

Let's secure some stuff!

Syllabus

  • Installing the Security Bundle
  • Creating the User Class
  • Creating a Login Form
  • Understanding Password Hashing
  • app.user and Login/Logout Links
  • Protecting Logout with CSRF
  • Enabling "Remember Me" Feature
  • Authentication Attributes
  • User Roles
  • Role Hierarchy & Access Control
  • User Doctrine Relationship
  • Fetching the User in Services/Controllers
  • Creating a Custom Voter
  • Denying Access with a Voter
  • Impersonating Users with switch_user
  • Exiting Impersonation & IS_IMPERSONATOR
  • Limiting Login Attempts
  • Security Events: Tracking the Last Login
  • Creating a Registration Form

Taught by

Kevin Bond

Reviews

Start your review of Symfony Security: The Basics

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.