50% discount in conference replays
2020 and 2021 events
In English, French, German, Polish and Spanish

How to Simulate HTTP Authentication in a Functional Test

Edit this page

How to Simulate HTTP Authentication in a Functional Test

Caution

Starting from Symfony 5.1, a loginUser() method was introduced to ease testing secured applications. See Testing for more information about this.

If you are still using an older version of Symfony, view previous versions of this article for information on how to simulate HTTP authentication.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
Symfony 5.4 is backed by Private Packagist.