Download the PHP package wearesho-team/yii2-authorization without Composer
On this page you can find all versions of the php package wearesho-team/yii2-authorization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wearesho-team/yii2-authorization
More information about wearesho-team/yii2-authorization
Files in wearesho-team/yii2-authorization
Package yii2-authorization
Short Description Redis Authorization Tokens for Yii2
License MIT
Informations about the package yii2-authorization
Yii2 Authorization
Authorizing users using redis tokens for Yii2
Installation
Usage
Token Entity
To operate with access and refresh token pair you should use Token entity.
Configuration
For configuration you have to use ConfigInterface. Few implementations available out-of-box:
Config
Simple Yii2 base object: Config
Environment configuration
To use environment to configure authorization you should use [EnvironmentConfig](./src / EnvironmentConfig . php).
Environment keys(with default prefix):
- AUTHORIZATION_EXPIRE_INTERVAL -(default: null), seconds before access token will be expired
- AUTHORIZATION_REFRESH_EXPIRE_INTERVAL -(default: null), seconds before refresh token will be expired
Repository
To store tokens you should use Repository. It will store tokens in specified redis connection.
Bootstrap
To automatically configure ConfigInterface definition you should use Bootstrap.
For refresh token storage configuration you need to pass definition of RefreshTokenStorage implementation.
Available implementation:
- wearesho-team/yii2-authorization-refresh-storage-db for storing refresh token using SQL database.
HasToken
To implement part of yii`s web\Identity interface you should use HasToken trait, which implement findIdentityByAccessToken method and will allow to use something like HttpBearerAuth behaviors.
License
MIT
All versions of yii2-authorization with dependencies
horat1us/yii2-environment-config Version ^1.0
nesbot/carbon Version ^2.24 || ^3
ramsey/uuid Version ^3.6 | ^4.7
yiisoft/yii2 Version ^2.0.15
yiisoft/yii2-redis Version ^2.0