Skip to content

Initial Fork

Compare
Choose a tag to compare
@JimTools JimTools released this 19 Feb 15:36
· 109 commits to main since this release

Forked from tuupola/slim-jwt-auth resolves security* issue but also has breaking changes

Upgrade

  1. Switch over the package by using the following commands, for now the
    namespace is exactly the same.
composer remove tuupola/slim-jwt-auth
composer require jimtools/jwt-auth
  1. Update the JwtAuthentication config to have keys for the secret and
    algorithm to have a unique index.

Before

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "secret" => "supersecretkeyyoushouldnotcommittogithub",
    "algorithm" => ["HS256"]
]));

After

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "secret" => ["acme" => "supersecretkeyyoushouldnotcommittogithub"],
    "algorithm" => ["acme" => "HS256"],
]));
  1. (Maybe) If you are using multiple encryption algorithms you will need to add the kid
    to the JWT header.
    firebase JWT Docs