t73biz / cakephp2-jwt-auth Goto Github PK
View Code? Open in Web Editor NEWThis project forked from burzum/cakephp-bz-utils
CakePhp 2.0 JWT Authentication (DEAD)
License: Other
This project forked from burzum/cakephp-bz-utils
CakePhp 2.0 JWT Authentication (DEAD)
License: Other
My CakePHP app is version 2.6.2. I have added this to my Auth Component in the AppController.
'JwtAuth.JwtToken' => array( 'fields' => array( 'username' => 'email', 'password' => 'password', 'token' => '_token' ), 'parameter' => '_token', 'contain' => array( 'Organization' ), 'scope' => array( 'User.status' => 'A', 'User.locked_out' => 0, 'Organization.status' => 'A', ), 'header' => 'X_JSON_WEB_TOKEN', 'pepper' => 'pepper' // Says pepper because I do not want to show the pepper key I used for my code ),
I know that the plugin runs because I add a die statement in the getUser function in the plugin and it shows up when I do the API request.
When I debug $request, I do not get the header as part of the request. I am using Postman for testing the API and Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjoiMTIiLCJzdWIiOiIxMiJ9LCJpYXQiOjE0ODcyNTUxMjYsImV4cCI6MTQ4NzI1ODcyNn0.5hoyXltPmEXIA3eVtJnnn3Dor2lhviej31eZNbaMbow
for the token.
Hi,
One of the requirements in your composer.json is for PHPUnit 4.6, but CakePHP 2.x only support up to version 3.7.38 (http://book.cakephp.org/2.0/en/development/testing.html).
I also get an error when trying to install this with composer: "t73biz/cakephp2-jwt-auth 1.0.6 requires phpunit/phpunit ~4.6 -> no matching package found.".
Looking at the PHPUnit repo. I don't see a tag for "4.6", only "4.6.x", so perhaps this should be "~4.6.x" in your composer.json? (I'm not sure. Composer is not my strong suit).
In any case, can't install this currently on CakePHP 2.7.x.
Thanks,
Mike
Hi,
Is there any documentation for your plugin? I don't have access to configure my server with the dependencies requires to run the Tests so I can't see any example of how to use this.
Thanks in Advance,
Bob.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.