ebidtech/simple-authentication
Composer 安装命令:
composer require ebidtech/simple-authentication
包简介
A simple authentication using key and secret
README 文档
README
A simple authentication library using a key and secret.
Requirements
- PHP >= 5.4
Installation
The recommended way to install is through composer.
Just create a composer.json file for your project:
{
"require": {
"ebidtech/simple-authentication": "@stable"
}
}
Tip: browse ebidtech/simple-authentication page to choose a stable version to use, avoid the @stable meta constraint.
And run these two commands to install it:
$ curl -sS https://getcomposer.org/installer | php
$ composer install
Now you can add the autoloader, and you will have access to the library:
<?php require 'vendor/autoload.php';
Usage
$credentials = new CredentialsConfig( array( new KeySecretConfig(new KeySecret('key1', 'secret1')), new KeySecretConfig( new KeySecret('key2', 'secret2'), true, // active false, // expired true // locked ) ) ); // returns true because the credentials match and is active $credentials->auth(new KeySecret('key1', 'secret1')); // returns false, the secret doesn't match $credentials->auth(new KeySecret('key1', 'wrong-secret')); // returns false, because is locked $credentials->auth(new KeySecret('key2', 'secret2')); // will not throw exception $credentials->authOrException(new KeySecret('key1', 'secret1'));
Contributing
See CONTRIBUTING file.
Credits
- Ebidtech developer team, compress Lead developer Eduardo Oliveira (eduardo.oliveira@ebidtech.com).
- All contributors
License
Compress library is released under the MIT License. See the bundled LICENSE file for details.
统计信息
- 总下载量: 113
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-12-02