Download the PHP package xihrni/yii2-behavior-signature without Composer
On this page you can find all versions of the php package xihrni/yii2-behavior-signature. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-behavior-signature
Yii2 鉴权行为
基于 Yii2 的接口鉴权行为
Install
Usage
生成签名步骤
- 从服务端拿到客户端ID和秘钥
- 准备好
_c
、_d
、_s
、_t
四个参数- _c:客户端ID
- _d:当前时间戳(秒)
- _s:计算数值,取当前时间戳(秒)后6位 * 12345.6789,再进行进一取整
- _t:Token,将上面三个参数拼接到 URL 参数最后进行 MD5 加密后再拼接上面三个参数的值,接着拼接客户端秘钥,最后进行 SHA1 加密
- 将上面四个参数拼接到需要访问的 URL 参数最后进行请求
Example
需要请求的URL
组装之后的URL
Demo
客户端签名生成
服务端验证调用
All versions of yii2-behavior-signature with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
*
The package xihrni/yii2-behavior-signature contains the following files
Loading the files please wait ....