diuitapi/php-session-helper
Composer 安装命令:
composer require diuitapi/php-session-helper
包简介
Diuit Session Token Helper, to make easier the session token creating process
README 文档
README
A simple PHP library to help you authenticate your devices from backend easier. It returns session token, which you have to pass to your device and login with it.
Installation
Package is available on Packagist, you can install it using Composer.
composer require diuitapi/php-session-helper
Dependencies
- PHP 5.4+
Basic usage
Getting session token
Just use the DiuitTokenHelper to get a session token:
use Diuit\DiuitTokenHelper; $session = (new DiuitTokenHelper())->setAppId('your_app_id') // Configures app ID ->setAppKey('your_app_key') // Configures app key ->setKeyID('your_key_id') // Configures key id for finding public key ->setPrivateKey('file://your_pem_file_path') // Configures private key (you can either use file path or plain text) ->setUserSerial('user_serial') // Configures user serial ->setExpDuration(7*24*3600) // Configures length of session valid duration (in seconds), example is in length of a week ->getSessionToken('your_device_serial', 'gcm', 'device_push_token'); // Configures device serial, platform and push token(optional) and retrieves session token echo $session; // will print session token
And then ... ?
Pass the session token you got here to your client (may be an app or browser), and login your client with it for using more features of Diuit Messaging API.
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2016-03-04