Thanks @odan, this looks like it will be very useful for those of us just transitioning to Slim!
thanks daniel for this, helped me a lot in understanding whats going on behind the scenes.
is there a way to convince you to add a use case with jwt authentication to this tutorial?
Hi @stefanvz Thank you
That’s a good idea. I think I write a new blog post about OAuth 2.0 in combination with JWT.
Nice looking forward to it.
I wrote a tutorial on how to create and validate JWT with public/private keys using lcobucci/jwt. The tutorial also shows how to convert the token into an OAuh 2.0 Access Token Response. You can also reuse or implement your custom user authentication. You can protect single routes and/or route groups via JwtMiddleware. Read more:
https://odan.github.io/2019/12/02/slim4-oauth2-jwt.html
You may also try tuupola/slim-jwt-auth instead.
thanks Daniel. good addition to your tutorial and helped me to make my solution more robust.
This depends on your use case. In most cases, the authentication is getting done via HTTP Basic Auth to get a JWT. The tuupola/slim-basic-auth component works very good in combination with Slim. I think I will write a blog post about this topic in the next days.