4

I'm currently using the node-jsonwebtoken (https://github.com/auth0/node-jsonwebtoken) library to generate an auth token. I simply call jwt.sign to generate the token.

On my staging and development servers, the token that is generated is 941 characters, but on my production server (with 8x the number of CPUs and larger RAM but no other differences), it is much much larger (>8KB). Does anyone know why this is -- best guess for me right now is that it's generated based on my RAM or multiple CPUs, but that's just a correlation.

What should I do to lower the size of the token? On my client, I'm not allowed to send requests with headers that exceeds 8KB.

Thanks

Edward Sun
  • 1,541
  • 3
  • 15
  • 26
  • 1
    Could you include some sample code that you are using? The same input should generate the same output, so something in the input must be changing from Dev to Prod. – jjathman Oct 30 '14 at 20:06
  • 1
    Is the payload the same in both cases? – mrVoid Nov 03 '14 at 13:05
  • How large is the secret? – Amin Shah Gilani May 26 '15 at 15:25
  • I don't know it is based on the RAM but it's definitely based on Payload you are using generate token...Important thing here is token should be less than 8kb for transferring token through header so take that into consideration before creating TOKEN – santhosh Jun 20 '17 at 08:31

0 Answers0