Download the PHP package sergeymakinen/yii2-jwt-user without Composer
On this page you can find all versions of the php package sergeymakinen/yii2-jwt-user. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sergeymakinen/yii2-jwt-user
More information about sergeymakinen/yii2-jwt-user
Files in sergeymakinen/yii2-jwt-user
Package yii2-jwt-user
Short Description JWT (JSON Web Token) User component for Yii 2
License MIT
Homepage https://github.com/sergeymakinen/yii2-jwt-user
Informations about the package yii2-jwt-user
JWT powered User for Yii 2
JWT (JSON Web Token) based Yii 2 User component drop-in replacement.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Set the following Yii 2 configuration parameters:
Also set identityClass
to whatever your identity class name is.
Don't forget: set key
to some random value and make sure it's secret and long enough.
Configuration
You can choose between 3 different modes of sign key generation:
$useAuthKey value |
$appendAuthKey value |
Resulting key |
---|---|---|
false |
false |
sergeymakinen\yii\jwtuser\User::$key |
true |
false |
yii\web\IdentityInterface::getAuthKey() |
true |
true |
sergeymakinen\yii\jwtuser\User::$key concatenated with yii\web\IdentityInterface::getAuthKey() |
Your choice depends on how you're going to use identities, revoke old/compromised keys.
It's also possible to specify "audience" and "issuer" claims (and validate against them) via corresponding $audience
and $issuer
properties. They both may be either strings or Closure
returning a string.