t73biz/cakephp2-jwt-auth
最新稳定版本:1.1.0
Composer 安装命令:
composer require t73biz/cakephp2-jwt-auth
包简介
Cakephp 2 JWT Authentication
README 文档
README
CakePHP 2.x JWT Authentication (DEAD)
This project is no longer being actively developed.
This plugin is a CakePHP 2.x Authentication component and view helper for JWT.
Components
- Auth/JwtTokeAuthenticate - A JSON Web Token implementation for CakePHP 2.6.x
Helpers
- AuthHelper - Utility functions for helping with the authentication of users.
Requirements
- PHP version: PHP 5.3+
- CakePHP version: 2.6 Stable
Support
For support and feature request, please visit the JWT Authentication Plugin Support section.
License
Copyright 2011 - 2014, Florian Krämer Copyright 2015, Ronald Chaplin
Licensed under The MIT License
Redistributions of files must retain the above copyright notice.
Copyright
Copyright 2011 - 2014 Florian Krämer http://github.com/burzum
Copyright 2015 Ronald Chaplin http://github.com/t73biz
Version
1.0.6
Installation
composer require t73biz/cakephp2-jwt-auth 1.0.6
This will install into the Plugin directory (in the JwtAuth folder). To run the tests, simply navigate to your webroot/test.php and follow the links for the test cases for the Authentication Adapter.
Usage
Configuration
You can either declare this in your Controller's $components array, or on the fly in an action (if you need to load any configuration values, which you can't do when declaring in the $components array, for example).
public $components = array(
'Auth' => array(
'authenticate' => array(
'JwtAuth.JwtToken' => array(
'fields' => array(
'username' => 'username',
'password' => 'password',
'token' => 'public_key',
),
'parameter' => '_token',
'userModel' => 'User',
'scope' => array('User.active' => 1),
'pepper' => 'sneezing',
),
),
),
);
Or
$this->Auth->authenticate['JwtAuth.JwtToken'] = array(
'fields' => array(
'username' => 'username',
'password' => 'password',
'token' => 'public_key',
),
'parameter' => '_token',
'userModel' => 'User',
'scope' => array('User.active' => 1),
'pepper' => Configure::read('API.token.pepper'),
);
Where (excluding common authentication items):
fieldsis an array containing the details of which passed values (POSTed) contain theusername,passwordandtokentokenis used to hold a unique key against the user once authenticated and is also stored in the JWT
parameteris the query string parameter that could hold the JWTheaderis the HTTP header that could hold the JWTpepperis the salt to use when encrypting your JWT (keep this super secret!)
Defaults
array(
'fields' => array(
'username' => 'username',
'token' => 'token'
),
'parameter' => '_token',
'header' => 'X_JSON_WEB_TOKEN',
'userModel' => 'User',
'scope' => array(),
'recursive' => 0,
'contain' => null,
'pepper' => '123'
);
Authentication
You can authenticate by passing a valid JWT as either:
- The query string parameter defined as
parameterin the config array (defaults to_token) - The contents of the header defined as
headerin the config array (defaults toX_JSON_WEB_TOKEN)
TODO
Implement an end to end example for inside clients and 3rd party client usage.
t73biz/cakephp2-jwt-auth 适用场景与选型建议
t73biz/cakephp2-jwt-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.95k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「cakephp」 「jwt」 「authenticate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 t73biz/cakephp2-jwt-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 t73biz/cakephp2-jwt-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 t73biz/cakephp2-jwt-auth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
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.
A simple library to decode and parse Apple Sign In client tokens.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
JWT API authentication driver (Guard) for Laravel.
统计信息
- 总下载量: 3.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-02