miladrahimi / php-jwt Goto Github PK
View Code? Open in Web Editor NEWA PHP implementation of JWT (JSON Web Token) generator, parser, verifier, and validator.
License: MIT License
A PHP implementation of JWT (JSON Web Token) generator, parser, verifier, and validator.
License: MIT License
Line 154 in 6555d0d
This code line will throw an exception when any other JTW type besides "jwt" is found.
This RFC https://datatracker.ietf.org/doc/html/rfc9068 registers the type "at+jwt" for OAuth2 access tokens and I think this library should be able to validate them.
Section 4 of the RFC outlines the validation steps needed, which seems to be pretty much in line with what this library does anyway:
In case the access token is encrypted, it would need to be decrypted, same holds for type "jwt". What do you think?
ADD SUPPORT FOR PS256
ALGORITHM
Right now all the exceptions inherit from \Exception
. This means I have no way to catch specifically exceptions from this library, other than catching each separate possible exception type, and that's not maintainable.
If you had a (possibly abstract) base exception class and had all your other exceptions inherit from that, my error handling could be simpler, since I could catch that parent exception type.
I am grabbing the public key I want to verify a token against from the web. Currently as far as I can tell with this library I'd need to save that to a file in order to pass that file path into RsaPublicKey
's constructor.
It'd be nice if I didn't need to do that middle step.
I'm a little confused about why the current behaviour is as it is, given how openssl_pkey_get_public
works -- its docs say that it supports various formats of inputs including a PEM string like I have or a filename in the format file://path/to/file.pem
already, among a couple of others, so why not pass an argument straight through?
Exp must be newer than now
time() > exp
, must be exp > time()
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.