Step-by-step Guide to use Auth0 with Symfony 6

Introduction

Auth0 is a very powerful solution to manage the authentication of your applications.
Even if its documentation is very well done, it is not immediate to understand how to use it.
The PHP SDKs allow you to do many things and today I would like to show how I use them to authenticate a user in a Symfony application.
I’ll show you step by step how to implement statefull authentication and stateless authentication.

So let’s try to write our application, first take a look at the workflow we want to implement.

Priority keys: Symfony application running and security installed

$ composer require symfony/security-bundle

Workflow

1) A command or route to create an account on Auth0 with a temporary password.
2) An invitation/activation email is sent to your account email with a link to change your password.
3) The login allows the user to connect via Auth0 and authenticate him on the Symfony application.


Continue reding on Medium

Leave a comment