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

SymfonyCasts

Symfony Security: Beautiful Authentication, Powerful Authorization

via SymfonyCasts

Overview

Oh no, it's time to add security! Ahhh!

Wait, come back! Security in Symfony is awesome! Seriously, between things called "voters" and the Guard authentication system, you can do anything you want inside of Symfony, and the code to do it is simple and expressive.

Security has two sides: authentication (who are you?) and authorization (do you have access to do X). We'll talk about each of these, creating an traditional form login system and and API token authentication. Then, we'll turn to authorization, with roles, voters and other good stuff:

  • Making a User with the fancy new make:user command (ooOOOoo)
  • Security & Firewall Fundamentals
  • Creating a custom login form
  • CSRF protection
  • API token authentication system
  • All about Guard authentication
  • User Providers (why you need them, but don't care)
  • Password Encryption
  • Logging out!
  • Protecting entire URLs with access_control(s)
  • IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED
  • Checking access with roles! ROLE_USER
  • Denying access in a controller
  • What are voters?
  • Role hierarchies
  • Impersonation (switch_user)
  • Automatic Login (after Registration)

... and how to create a back door into your... spaceship... that will allow it to be destroyed with one careful shot. Just kidding! Let's make some secure sites / spaceships!

Syllabus

  • Security & the User Class
  • All about the User class
  • Customizing the User Entity
  • The Login Form
  • Firewalls & Authenticator
  • Login Form Authenticator
  • Redirecting on Success & the User Provider
  • Authentication Errors
  • Customizing Errors & Logout
  • CSRF Protection
  • Adding Remember Me
  • Adding & Checking the User's Password
  • access_control Authorization & Roles
  • Target Path: Redirecting an Anonymous User
  • Deny Access in the Controller
  • Dynamic Roles
  • IS_AUTHENTICATED_ & Protecting All URLs
  • Fetch the User Object
  • Custom User Method
  • Fetching the User In a Service
  • Role Hierarchy
  • Impersonation (switch_user)
  • Serializer & API Endpoint
  • API Auth: Do you Need it? And its Parts
  • ApiToken Entity
  • Entry Point: Helping Users Authenticate
  • API Token Authenticator
  • API Token Authenticator Part 2!
  • Manual Authentication / Registration
  • Author ManyToOne Relation to User
  • Article Admin & Low-Level Access Controls
  • Voters
  • Adding a Custom Voter

Taught by

Ryan Weaver

Reviews

Start your review of Symfony Security: Beautiful Authentication, Powerful Authorization

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.