Replies: 2 comments 1 reply
-
Hi @dlhenke, well come back! As you can see things have changed a lot: we rarely use require, class files named aren't "foo.class.php" nor is the constructor the name of the class😭. If you are using the Slim-Skeleton then this shouldn't be too troublesome. But I'm interested to know what you are having difficulty with exactly, and if there's something I can do to improve the docs. However my preferred way would be to register everything in the container first in use DI\ContainerBuilder;
use JimTools\JwtAuth\Middleware;
use JimTools\JwtAuth\Options;
use JimTools\JwtAuth\Decoder\DecoderInterface;
use JimTools\JwtAuth\Decoder\FirebaseDecoder;
return function (ContainerBuilder $containerBuilder) {
$containerBuilder->addDefinitions([
// ...
DecoderInterface::class => function (SettingsInterface $settings) {
return new FirebaseDecoder(new Secret($settings['JWT_SECRET'], 'HS256'));
},
JwtAuthentication::class => function (SettingsInterface $settings, DecoderInterface $decoder) {
return new JwtAuthentication(new Options(), $decoder);
},
// ...
]);
}; then assuming you want to register the middleware globally, just add it in return function (App $app) {
// ...
$app->add(JwtAuthentication::class);
}; finally in hope this helps. |
Beta Was this translation helpful? Give feedback.
-
jwt-auth-example I crated a reference implementation using slim skeleton. With some basic pointers as you’re migrating it might not be much help but I’m sure it will help somebody. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm struggling to implement jwt-auth V2.2 on a Slim-Skeleton..
I'm trying to migrate my application that was running on a Slim V3 to V4 using the newest version of all dependencies.
I need Help .. I'm already 66 Yo working with PHP since 1997 and I was stopped in time, recently migrated to php 7 and now Learning the fabulous PHP 8..
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions