Token MongoDB/MySQL generator
With this extension you easy generate token on one application and
use this token on other application. Tokens are saved on the MongDB/MySQL., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist yiicod/tokenmanager "*"
or add, (*4)
"yiicod/tokenmanager": "*"
Config ( This is all config for extensions ):
'components' => [
...
'tokenManager' => [
'class' => 'yiicod\tokenmanager\MongoDbPhp7TokenManager',
'connectionString' => 'mongodb://IP:PORT',
'privateKey' => 'Required',
'dbName' => 'DB name',
'collectionName' => 'Collection name',
]
]
Generate token:
Yii::app()->tokenManager->generate(array('id' => $model->id))
Load token:
$token = Yii::app()->tokenManager->load($token);
Validate token:
Yii::app()->tokenManager->validate($token);