outermedia/pdo-authenticator
Composer 安装命令:
composer create-project outermedia/pdo-authenticator
包简介
Generic PDO-Authentication
关键字:
README 文档
README
General php authenticator based on PDO to check logins.
##Installation
At first install or download composer.phar to your computer. Follow the instructions provided by getcomposer.org.
Step 1: Download the project
Create an intermediate directory, cd into it and download the latest distribution without tests:
php ~/php/composer.phar --prefer-dist require outermedia/pdo-authenticator
This creates files in your current working directory:
├── composer.json
├── composer.lock
└── vendor
│ ...
└── outermedia
└── pdo-authenticator
├── LICENSE
├── README.md
├── composer.json
├── composer.lock
└── src
└── main
└── webapp
├── Om
│ └── Pdo
│ └── Authenticator
│ ├── DatabaseConfiguration.php
│ ├── DatabaseQueryBuilder.php
│ ├── PdoAuthenticator.php
│ └── RequestHandler.php
├── dbconf.php.template
└── index.php
Hint: If you want to run the phpunit tests, additionally run (creates new directoy pdo-authenticator/):
php ~/php/composer.phar --prefer-source create-project outermedia/pdo-authenticator
pushd pdo-authenticator && vendor/bin/phpunit src/test/php/ && popd
Note: The dbunit tests require sqlite3.
###Step 2: Deploy the files
Now copy the files to your destination directory ($DEST)
cp -r vendor/outermedia/pdo-authenticator/src/main/webapp/* $DEST
Step 3: Rename the database settings template
Rename the file dbconf.php.template:
mv $DEST/dbconf.php.template $DEST/dbconf.php
Step 4: Set your database options
Edit dbconf.php.
Options are:
- pdoUrl - a PDO connection URL e.g. for a local mysql and a database dbname1 "mysql:host=localhost;dbname=dbname1"
- dbUser - the username used for the database connection
- dbPassword - the password used for the database connection
- table - the database table name which holds the user information
- usernameColumn - the column name which stores the username (of table)
- passwordColumn - the column name which stores a user's password (of table)
Step 5: Test you installation
Two POST actions are supported:
a) Get a user's salt ("user1"): Encode your form parameters with the specified charset!
curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
--data 'action=getsalt&login=user1' http://localhost/pdo-auth/index.php
should return something like:
{"charset":"latin1","result":true,"salt":"$1$rasmusl1"}
The charset used by the database table, the salt and a success flag ("result").
b) Check a user's login: pwd is the calculated hash.
curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
--data 'action=login&login=user1&pwd=$1$rasmusl1$2ASuKCrDVFQspP8.yIzVl.' \
http://localhost/pdo-auth/index.php
The expected answer is e.g.
{"charset":"latin1","result":true}
The flag "result" indicates the success.
outermedia/pdo-authenticator 适用场景与选型建议
outermedia/pdo-authenticator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.93k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「login」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 outermedia/pdo-authenticator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 outermedia/pdo-authenticator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 outermedia/pdo-authenticator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
Email Toolkit Plugin for CakePHP
统计信息
- 总下载量: 3.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-19