mediawiki / guzzle-json-auth
使用可配置的 Guzzle 客户端通过 JSON 端点进行身份验证
0.1.2
2018-11-21 16:54 UTC
Requires
- php: >=5.4.0
- composer/installers: ^1.0.1
- guzzlehttp/guzzle: ^5.2.0
Requires (Dev)
- phpunit/phpunit: ^4.0.0
- scrutinizer/ocular: ^1.1.0
- squizlabs/php_codesniffer: ^2.1.0
This package is auto-updated.
Last update: 2024-09-22 05:52:52 UTC
README
使用可配置的 Guzzle 客户端通过 JSON 端点对 MediaWiki 进行身份验证
安装
要求
- PHP >= 5.4
- Composer
- MediaWiki 1.22
通过 Composer
$ composer require mediawiki/guzzle-json-auth
用法
要设置身份验证,请将以下行添加到您的 LocalSettings.php 中,并根据需要更改值
# Setup GuzzleJsonAuth $wgGuzzleJsonAuthUrl = 'http://yourapplication.com/your_json_endpoint'; $wgGuzzleJsonRequestBaseKey = 'User'; $wgGuzzleJsonRequestUsernameKey = 'username'; $wgGuzzleJsonRequestPasswordKey = 'password'; $wgGuzzleJsonResponseBaseKey = 'user'; $wgGuzzleJsonResponseUsernameKey = 'username'; $wgGuzzleJsonResponseRealNameKey = 'real_name'; $wgGuzzleJsonResponseEmailKey = 'email'; // Load and initialize the GuzzleJsonAuth extension require_once("$IP/extensions/GuzzleJsonAuth/GuzzleJsonAuth.php"); $wgAuth = new \MediaWiki\GuzzleJsonAuth\GuzzleJsonAuth();
认证用户将在您的 Wikis 数据库中创建,但没有密码。
认证端点需要至少返回认证用户的用户名、真实姓名和电子邮件作为结果。如果认证失败,则不应返回用户名,否则用户仍将被登录。
如果用户无法在外部进行身份验证,则此扩展将回退到本地身份验证。
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG.md
测试
$ phpunit
贡献
有关详细信息,请参阅 CONTRIBUTING
安全
如果您发现任何安全相关的问题,请通过电子邮件 ravage@bluewin.ch 联系,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件