Coder Social home page Coder Social logo

php-jwt's Introduction

Milad Rahimi

Website Twitter Go PHP

website linkedin instagram twitter stackoverflow facebook

php-jwt's People

Contributors

augustowebd avatar miladrahimi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

php-jwt's Issues

Invalid key exception, while private and public key is there

Hey, can you please help me? i found this error with NULL message

I use on Codeigniter and Windows OS, i'm little bit confused because in my MacOs, it's worked, and i dont change anything on the source code and the .pem file of public and private key.

e73aa7f9-723c-41e5-a003-63a02a6c0b10

Support at+jwt access token type

if ($fields['typ'] !== 'JWT') {

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:

  • validate signature
  • validate ISS
  • validate AUD
  • validate EXP

In case the access token is encrypted, it would need to be decrypted, same holds for type "jwt". What do you think?

Have the various exceptions inherit from a single exception type

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.

Allow keys to be instantiated from strings rather than only from files

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.