Giter VIP home page Giter VIP logo

jsonwebtoken.io's People

Contributors

bretterer avatar dogeared avatar kelseychayes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

jsonwebtoken.io's Issues

Provide a sample JWT

It would be nice to have an example JWT available on the site, so someone can quickly see what it looks like.

Decoded fields are incorrect after clicking away

Steps to reproduce:

  1. Go to http://jsonwebtoken.io
  2. Paste this JWT:
eyJraWQiOiI0VlBWTEI2SzQ0UllTS1JSVkFCNFRFQk9YIiwic3R0IjoiYWNjZXNzIiwiYWxnIjoiSFMyNTYifQ.eyJqdGkiOiIyUXd0WmVQNlhRVnRzOVVqdEhnbk1XIiwiaWF0IjoxNDY5MDQwODM2LCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy83T2wzNzdIVTA2OGxhZ0NZazdVOVhTIiwic3ViIjoiaHR0cHM6Ly9hcGkuc3Rvcm1wYXRoLmNvbS92MS9hY2NvdW50cy81TXdMZWFpd3dSaEZUcXl3aTRvU0xRIiwiZXhwIjoxNDY5MDQ0NDM2LCJydGkiOiIyUXd0WmI1MWNxQ3ZGS09zaDFwV2tTIn0.dIGVPO0RlXDvfAXyuH6wshGQA1YUTwDDa9rK8H-p02I
  1. Notice the header has 4 elements, and the exp claim is 1469044436
  2. Click outside of the JWT String text box
  3. The header now has only 2 elements, and the exp has been updated

Render durations in comments

Decoding the Unix timestamps in the comments is a great touch! It'd be nice if it also rendered human durations, like:

  "iat": 1463530023,  // Tue May 17 2016 17:07:04 GMT-0700 (PDT)  [now]
  "nbf": 1463530023,  // Tue May 17 2016 17:07:03 GMT-0700 (PDT)  [now] 
  "exp": 1463530323,  // Tue May 17 2016 17:12:03 GMT-0700 (PDT)  [in 5 minutes]

Custom header - invalid php-jwt code

When we have custom "Header" keys, the auto-generated code for firebase/php-jwt does not accomodate for it.

It should add something like:

$keyId = null;

$header = array(
    "alg" => "RS256",
    "typ" => "JWT",
    "x5t" => "somecustomstring"
);
...
$jwt = JWT::encode($payload, $privateKey, 'RS256', $keyId, $header);
...

In my case I need to add custom header with key "x5t" that contain certificate thumbprint (Microsoft/Azure token stuff)

Likewise, I don't see it specifying encoding algorithm, so it will drop to whatever is the default (HS256).

php-jwt function declaration:
public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null)

Subtle coloring to highlight JWT segments

Some kind of (very unobtrusive) coloring or other highlighting would be nice so it's possible to visually tell the 2 (or 3) segments of a JWT apart from each other.

JWT: Can see token contents without payload

Hello

The documentation is not very clear when it comes to my understanding of the following.

Consider a JWT token is created in nodejs:

token() {
const payload= {
exp: moment()
.add(jwtExpirationInterval, "minutes")
.unix(),
iat: moment().unix(),
sub: this._id
};
return nJwt.create(playload, jwtSecret,"HS256").compact();
},

Now, without the "jwtSecret", I am able to see the "payload";

So, there is something wrong in my encoding, right? OR Is the secret key used ONLY to verify the payload?

many thanks

Ability to have best-practices generated keys

On of the things I like about java.jsonwebtoken.io is that it generates a key for the HS algorithm variants. And, the key it generates is always a base64 encoded binary byte array that's the max-width the given algorithm supports.

For instance, if you change the algorithm from HS256 to HS512, you'll notice a much longer key is generated.

It'd be nice to have this - as an option at least - for jsonwebtoken.io.

Most examples on the web use secret for the secret which, while human readable, is an anti-pattern that we shouldn't propagate.

Algorithm not allowed in file

I'm trying to decode a jwt token using this command on my Laravel application:
$decoded = JWT::decode($access_token, $my_secret, array('HS256'));

but I'm having this message error all the time:
UnexpectedValueException: Algorithm not allowed in file C:\myserver\vendor\fproject\php-jwt\src\JWT.php.

When I use the same token on site jwt.io, the token is correctlly decoded. I'm doing everything based on documents on your site.

Any ideas about what is happenning here?

JWT signature is always verified

If I paste this JWT into the site:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJURVNUIiwianRpIjoiZjU4NDhiMDMtNWE0Zi00OGEzLTliN2UtNzgzNTk0ZWM0NmQ2IiwiaWF0IjoxNDY0MDQ0NzIzLCJuYmYiOjE0NjQwNDQ3MjMsImV4cCI6MTQ2NDA0NTAyMywiaXNzIjoiRXhhbXBsZUlzc3VlciIsImF1ZCI6IkV4YW1wbGVBdWRpZW5jZSJ9.x71rScjuEBI1Q1gkLjh1wpaApnz2_m6OoAvOCLuqn0o

The signature panel will always say "Verified", even if I type garbage into the text box. The actual signing key is "mysupersecret_secretkey!123".

Please support JWKS

Istio requires a JWKS to verify a JWT. Can a feature be added where this is generated for us somehow?

Editing the payload destroys the header

If I paste the following JWT into the tool:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxYjFaMTdLa0xBV09UTUg4cXA2aU1SIiwiaWF0IjoxNDcyNjY0NDU0LCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy83T2wzNzdIVTA2OGxhZ0NZazdVOVhTIiwic3ViIjoiaHR0cHM6Ly9hcGkuc3Rvcm1wYXRoLmNvbS92MS9hY2NvdW50cy80cVRYMlF5UlZoT05kNWVRcDdoVFEwIiwiZXhwIjoxNDcyNjgxNDkwLCJydGkiOiI0NmZBSE90N1laNUVvOFIyMzVQa0YifQ.hLjNfYpf3sQ1rD-Kc9Y0yaEK3TNDq6ohDvEcamM6e7Y

Which as a header like:

{
 "typ": "JWT",
 "alg": "HS256",
 "kid": "4VPVLB6K44RYSKRRVAB4TEBOX",
 "stt": "access"
}

and then edit the payload, the header is rewritten as

{
  "typ": "JWT",
  "alg": "HS256"
}

Robust support for cookie strings

I frequently copy and paste cookies, and my network sniffer tool copies them in the format name=value. It'd be nice to support parsing things like this automatically:

access_token=eyJrablahblahblah...

Algorithm Changes When Window Focus is Lost

HS512 algorithm always fails because the algorithm resets to 256 when the browser window loses focus.

Chrome Version 57.0.2987.133 (64-bit) on Mac OS Sierra 10.12.4 (16E195)

Addons: keepa, postman, ublock origin, tab resize

Uncaught TypeError: Cannot read property '2' of null

screen shot 2018-07-24 at 2 45 23 pm
screen shot 2018-07-24 at 2 44 18 pm

while encrypting my text using RS256, RS384, RS512, ES256, ES384, ES512 then i got above error.

var jwt=nJwt.create(data,'secret',"ES384")
var token=jwt.compact(); //got error in this line
can someone help me please?

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.