Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Updating PSR name
Browse files Browse the repository at this point in the history
  • Loading branch information
JimTools committed Feb 19, 2024
1 parent 3cc1b08 commit 662f965
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# PSR-7 and PSR-15 JWT Authentication Middleware
> [!IMPORTANT]
> This is a drop in replacement for `tuupola/slim-jwt-auth` with the updated version of `firebase/php-jwt` to resolve
> [CVE-2021-46743](https://nvd.nist.gov/vuln/detail/CVE-2021-46743) for the meantime I plan to maintiane conpatability in v1
> V2 I plan to deverge
> [CVE-2021-46743](https://nvd.nist.gov/vuln/detail/CVE-2021-46743) for the meantime I plan to maintiane conpatability in v1,
> v2 I plan to deverge
This middleware implements JSON Web Token Authentication. It was originally developed for Slim but can be used with any framework using PSR-7 and PSR-15 style middlewares. It has been tested with [Slim Framework](http://www.slimframework.com/) and [Zend Expressive](https://zendframework.github.io/zend-expressive/).

[![Latest Version](https://img.shields.io/packagist/v/jimtools/slim-jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/slim-jwt-auth)
[![Packagist](https://img.shields.io/packagist/dm/jimtools/slim-jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/slim-jwt-auth)
[![Latest Version](https://img.shields.io/packagist/v/jimtools/jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/jwt-auth)
[![Packagist](https://img.shields.io/packagist/dm/jimtools/jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/jwt-auth)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jimtools/slim-jwt-auth/tests.yml?branch=main&style=flat-square)](https://github.com/jimtools/slim-jwt-auth/actions)
[![Coverage](https://img.shields.io/codecov/c/gh/jimtools/slim-jwt-auth/main.svg?style=flat-square)](https://codecov.io/github/jimtools/slim-jwt-auth/branch/main)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jimtools/jwt-auth/tests.yml?branch=main&style=flat-square)](https://github.com/jimtools/jwt-auth/actions)
[![Coverage](https://img.shields.io/codecov/c/gh/jimtools/jwt-auth/main.svg?style=flat-square)](https://codecov.io/github/jimtools/jwt-auth/branch/main)


Heads up! You are reading documentation for [3.x branch](https://github.com/tuupola/slim-jwt-auth/tree/3.x) which is PHP 7.4 and up only. If you are using older version of PHP see the [2.x branch](https://github.com/tuupola/slim-jwt-auth/tree/2.x). These two branches are not backwards compatible, see [UPGRADING](https://github.com/tuupola/slim-jwt-auth/blob/main/UPGRADING.md) for instructions how to upgrade.
Expand All @@ -20,12 +19,16 @@ Middleware does **not** implement OAuth 2.0 authorization server nor does it pro

For example implementation see [Slim API Skeleton](https://github.com/tuupola/slim-api-skeleton).

## Breaking Channges
Because of the way firebase/php-jwt:v6 now works, the way `secrets` and `algorithm` are pass needs
to change

## Install

Install latest version using [composer](https://getcomposer.org/).

``` bash
$ composer require jimtools/slim-jwt-auth
$ composer require jimtools/jwt-auth
```

If using Apache add the following to the `.htaccess` file. Otherwise PHP wont have access to `Authorization: Bearer` header.
Expand Down Expand Up @@ -141,7 +144,9 @@ When passing multiple algorithm it be a key value array, with the key being the
$app = new Slim\App;

$app->add(new Tuupola\Middleware\JwtAuthentication([
"secret" => "supersecretkeyyoushouldnotcommittogithub",
"secret" => [
"acme" => "supersecretkeyyoushouldnotcommittogithub",
"beta" => "supersecretkeyyoushouldnotcommittogithub",
"algorithm" => [
"amce" => "HS256",
"beta" => "HS384"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jimtools/slim-jwt-auth",
"name": "jimtools/jwt-auth",
"description": "Drop in replacement for tuupola/slim-jwt-auth",
"keywords": [
"psr-7",
Expand All @@ -9,7 +9,7 @@
"json",
"auth"
],
"homepage": "https://github.com/tuupola/slim-jwt-auth",
"homepage": "https://github.com/jimtools/jwt-auth",
"license": "MIT",
"authors": [
{
Expand Down

0 comments on commit 662f965

Please sign in to comment.