Skip to content

Instantly share code, notes, and snippets.

@skynyrd

skynyrd/jwt-reminder.md

Last active Apr 5, 2017
Embed
What would you like to do?
JWT Reminder

###JWT Reminder:

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

//Payload
{
  // RESERVED CLAIMS
  "iss" : "http://myapi.com", // issuer, recommended.
  // exp: Expiration time, recommended,
  // sub: subject, recommended,
  // aud: audience, recommended
  
  // PUBLIC CLAIMS
  "user" : "nodebotanist" // can be user name
  
  //PRIVATE CLAIMS for sharing info between parties
}

//Signature
HMACSHA256(base64UrlEncode(header) + "." + base64UrlEncode(payload), secret);
//Check header and payload after decode process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.