Hi! this is a simple page with four buttons and three links. The purpose of this page is to demonstrate how to use JWT for performant and secure requests. The page is connected to a couple of lambda functions for generating and clearing JWT's, and links to routes that are protected by JWT using both cloudflare workers and netlify role based route protection. The data in the inputs is just used to add custom "claims" to the JWT. Below are descriptions on what the buttons do:
  • GET JWT:
    This will generate a jwt that contains the information you enter on this page, and will expire in 1 hour. The JWT is saved in a cookie called nf_jwt
  • GET JWT W/ INVALID SIGNATURE:
    This will generate a JWT using the same information, but signed with a different secret. It will not validate.
  • CLEAR JWT COOKIE:
    This will delete the nf_jwt cookie.