Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/damirka/yii2-jwt

JWT implementation for Yii2 Authorization process
https://github.com/damirka/yii2-jwt

json-web-token jwt php yii2 yii2-extension yii2-framework yii2-jwt yii2-user

Last synced: 6 days ago
JSON representation

JWT implementation for Yii2 Authorization process

Awesome Lists containing this project

README

        

# yii2-jwt

JWT implementation for Yii2 Authorization process

For details see [JWT official website](https://jwt.io/introduction/).

## Installation

To install (only master is available now) run:
```
composer require "damirka/yii2-jwt:v0.2.1"
```
Or add this line to *require* section of composer.json:
```
"damirka/yii2-jwt": "v0.2.1"
```

## Usage

There is only one trait - *UserTrait* - which gives you 5 methods for
authorization and JWT-management in User model

Set up:

In controller:

```PHP
[
'class' => HttpBearerAuth::className()
]
]);
}
}
```

In User model:

```PHP