gabesullice / jwt Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://www.drupal.org/project/jwt
Home Page: https://www.drupal.org/project/jwt
I would like to obtain a JWT for a current user via a module, that I am writing, so that an external program can be launched that will process data and then return that data via the REST API. I would like to pass this external program the user's JWT so that when the data is posted back, it is "owned/created" by that user.
I would like to be able to write code like so:
$token = new JsonWebToken();
$encoded = (string) $token;
Thoughts @jonathangreen @bradjones1 ?
$ composer require drupal/jwt;
Using version ^1.0@alpha for drupal/jwt
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/cache v1.7.1 requires php ~7.1 -> your PHP version (7.0.14) does not satisfy that requirement.
- doctrine/cache v1.7.1 requires php ~7.1 -> your PHP version (7.0.14) does not satisfy that requirement.
- doctrine/cache v1.7.1 requires php ~7.1 -> your PHP version (7.0.14) does not satisfy that requirement.
- Installation request for doctrine/cache (locked at v1.7.1) -> satisfiable by doctrine/cache[v1.7.1].
Installation failed, reverting ./composer.json to its original content.
Is this a problem with composer or a problem with the libraries?
I will update php to see how its goes. thanks!
Hi, thanks for the module! Is there a reason why you choose firebase library? on the jwt.io page lcobucci library supports more algorithms.
Hello
Does this module support the use (validation, auth) of tokens that are generated by external, 3rd party auth providers?
Thanks
I would like to write code like so:
$payload = [
'my' => 'custom claims',
];
$token = JsonWebToken::create($payload);
After enabling the JWT module, and following this tutorial about how to use it, is working.
I know that I can access the user JWT token by going to: /jwt/token.
My problem is when I try to login via web services. It shows me this:
{
"current_user": {
"uid": "4",
"name": "cravushedal"
},
"csrf_token": "OlTb7fak5ZS-r1BRiGtBh4IWLm_Z7F1xMpY3KYTGkrU",
"logout_token": "5DiupHgr9iDxIDVmhHTI3PMX2-Shd6sjuN8hNHrHv7E"
}
No JWT token. What can I do to debug this?
When writing functional tests for a module that depends on jwt
, I keep getting this error: 1) Drupal\Tests\islandora\Functional\IslandoraFunctionalTestBase::testContextAdminPage Drupal\Core\Config\Schema\SchemaIncompleteException: No schema for jwt.config
This can be avoided by declaring jwt.config
in the configSchemaCheckerExclusions
array of BrowserTestBase
, but providing the schema in this module could save folks some heartache.
After tried to go to /admin/config/system/jwt i got this: The website encountered an unexpected error. Please try again later.
In the console log: Failed to load resource: the server responded with a status of 500 (500 Service unavailable (with message))
And, in the php error log this:
[Sat Mar 17 12:17:53.069028 2018] [fcgid:warn] [pid 56344:tid 3031629824] [client 127.0.0.1:62217] mod_fcgid: stderr: Uncaught PHP Exception InvalidArgumentException: "Class "\\Drupal\\jwt\\Form\\ConfigForm" does not exist." at /Users/josue/WebDevelop/angudru/drupal/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php line 24, referer: http://angudru.dd:8083/admin/modules
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.