edenspiekermann / craft-jwt-auth Goto Github PK
View Code? Open in Web Editor NEWEnable authentication to Craft through the use of Javascript Web Tokens (JWT)
License: MIT License
Enable authentication to Craft through the use of Javascript Web Tokens (JWT)
License: MIT License
Hello!
I would like to know how to use the plugin in order to generate a token and use it with my database in order to get some info from it, please I would some help. Right now I have a nodejs/express server using const jwt = require("jsonwebtoken");
.
Thank you in advance.
Is there any plan to update the plugin to work with Craft CMS 4?
Describe the bug
When I re-serve my Craft app, I get this error:
$ ./craft serve
Exception 'yii\base\UnknownPropertyException' with message 'Getting unknown property: craft\console\Request::headers'
in /path/to/craft/vendor/yiisoft/yii2/base/Component.php:154
Stack trace:
#0 /path/to/craft/vendor/edenspiekermann/craft-jwt-auth/src/services/JWT.php(40): yii\base\Component->__get('headers')
#1 /path/to/craft/vendor/edenspiekermann/craft-jwt-auth/src/CraftJwtAuth.php(62): edenspiekermann\craftjwtauth\services\JWT->getJWTFromRequest()
#2 [internal function]: edenspiekermann\craftjwtauth\CraftJwtAuth->edenspiekermann\craftjwtauth\{closure}(Object(yii\base\Event))
#3 /path/to/craft/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Object(Closure), Object(yii\base\Event))
#4 /path/to/craft/vendor/craftcms/cms/src/base/ApplicationTrait.php(1360): yii\base\Component->trigger('init')
#5 /path/to/craft/vendor/craftcms/cms/src/console/Application.php(65): craft\console\Application->_postInit()
#6 /path/to/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#7 /path/to/craft/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#8 /path/to/craft/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#9 /path/to/craft/vendor/craftcms/cms/src/console/Application.php(54): yii\console\Application->__construct(Array)
#10 [internal function]: craft\console\Application->__construct(Array)
#11 /path/to/craft/vendor/yiisoft/yii2/di/Container.php(384): ReflectionClass->newInstanceArgs(Array)
#12 /path/to/craft/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\console\\A...', Array, Array)
#13 /path/to/craft/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\console\\A...', Array, Array)
#14 /path/to/craft/vendor/craftcms/cms/bootstrap/bootstrap.php(244): yii\BaseYii::createObject(Array)
#15 /path/to/craft/vendor/craftcms/cms/bootstrap/console.php(34): require('/Volumes/BLUE/P...')
#16 /path/to/craft/craft(21): require('/Volumes/BLUE/P...')
#17 {main}
To Reproduce
Steps to reproduce the behavior:
./craft serve
)./craft serve
)Expected behavior
Craft running on serve.
Desktop (please complete the following information):
Hey is it possible to log in to craft using this plugin?
I am using NuxtJS and I would like to call an endpoint to log a user in and get a JWT back that I can use to make certain routes private in my app.
Many Thanks
It would be great if the Authorization header was an option that could be overwritten.
I found your plugin while researching ways to secure and streamline the Craft CP. We use Cloudflare and they offer a feature called Access that handles SSO at the edge, and once authorized makes the backend request with the header Cf-Access-Jwt-Assertion
. I think this would just "work" if the header this plugin checks was configurable.
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.