slim-jwt-auth icon indicating copy to clipboard operation
slim-jwt-auth copied to clipboard

Use against RS256

Open bujardeari opened this issue 6 years ago • 1 comments

Can this library be used against RS256 encoded tokens and how?

bujardeari avatar Sep 05 '18 07:09 bujardeari

Set RS256 as the algorithm and the public key as the secret.

$app = new Slim\App;

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "secret" => $publickey
    "algorithm" => ["RS256"]
]));

You can find example of how to generate the token in firebase/php-jwt README. This middleware uses firebase/php-jwt for decoding the token.

tuupola avatar Sep 05 '18 08:09 tuupola