11 - Symfony 4 REST: JWT API Authentication

preview_player
Показать описание

i made a really nice background for JWT with text and shit and then blurred it out, 200iq.

The title says it all, how to make an JWT token authentication system in Symfony 4 Using LexikJWTAuthenticationBundle, This goes through the very basic stuff and not into how you can can customize it like success messages or or token extactors, we will be taking a brief look into them later on when we get to the cookies section of the video, but for now just the bare minimum.

Рекомендации по теме
Комментарии
Автор

Hey !
Thank's for that wonderfull tutorial :D !
If anyone have trouble with postman to test the api/login_check use "raw" format instead of "form-data" it worked for me !

MrYousip
Автор

This video you created was super useful. I've been trying to lock down an API in Symfony for weeks now. Your vid allowed me to actually complete the task and hopefully please the boss. Thanks, keep making them.

Mrperezm
Автор

Thank you!!! After getting the token its just like dealing with a user who is logged in. You can check and restrict roles as normal. Was looking for a easy to use API for Symfony 5 and this works great!

customphpdesign
Автор

Brilliant video. I don't think it can be explained better. Thank you!

stefankosev
Автор

Just to clarify: OAuth2 and JWT are not exclusive, the first one is an authorization standard and the second one is token standard. You would usually use both together.

davidramentol
Автор

Thanks, you are the master of Symfony.

jonatham
Автор

Hello my problem => Unable to find the controller for path "/login_check". The route is wrongly configured.

beycandeveloper
Автор

Thank you brother with this video and I think revisiting this video since Symfony 4. Currently in Symofny5.3 I'm implementing JWT but while generating key it stuck. In Symfony 4 it worked, but in S5.3 at some dotted line it stuck forever idk, but i guess.

pranansubba
Автор

Thanks for the video. This sort of info is hard to find for some reason. You would think that something as common as API authentication or even just authentication in general would be better documented. The API-Platform documentation on this has their own way of doing it, insisting on using docker for everything, and leaving out important parts.

johngord
Автор

Very complete tutorial ! Thanks you so much, works like a charm !

raphaelcolboc
Автор

When i get token and try to insert the token in the header authorization bearer i got 401 token not found .

_danisson
Автор

Thank you so much! Newbie for symfony. My question is how did you get the hash password? Or how to create superadmin password? Thank you!

tark
Автор

This is brilliant! Great work! Thank you

fobtasz
Автор

Hie, I know this video was done there is one years
I have a question, is it possible to customize the response...
I would like to have something in response like this :
{"token": "blablabla", "user":"myUserName", "role":"myRole"}

sebastiendaireaux
Автор

Hola y gracias ... Tengo una pregunta, ¿cómo puedo personalizar la consulta del usuario, por ejemplo, verificar si el usuario está activo?, where you can customize that query?

MegaJuandelgado
Автор

Nice tutorial. Please, how I can generate the password hash, so I can fellow with the rest of the material ?

mani
Автор

I got error Unable to find the controller for path "/api/login_check" because
I tried to post using Postman with content type x-www-form-urlencoded.
In Postman when you select Body type as RAW type, it gives you selection to set data type as JSON, then you enter you data as JSON. Doing this will fix controller error

nurimustafa
Автор

Hi,

Thanks for the video !
I have question and is : can you make the time of the token unlimited ?

dahlizahmed
Автор

Thank's for this tutorial!

Great work!

arbitruVAR
Автор

Hi, how can I get authenticated user in a Controller?

nurimustafa