Slim 4 Tutorial

5 Likes

Thanks @odan, this looks like it will be very useful for those of us just transitioning to Slim!

1 Like

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?

1 Like

Hi @stefanvz Thank you :slight_smile:

That’s a good idea. I think I write a new blog post about OAuth 2.0 in combination with JWT.

2 Likes

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.

1 Like

thanks Daniel. good addition to your tutorial and helped me to make my solution more robust.

1 Like

is there a way to convince you to add a use case with jwt authentication to this tutorial?. .

1 Like

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.