Skip to content

edgio-docs/edgio-v7-ef-jwt-validation-example

Repository files navigation

JWT Verification using Edge Functions

This repository provides sample code for verifying JSON Web Tokens (JWT) using Edge Functions. The response varies according to whether it is able to verify the JWT.

  • Valid JWT: Returns the decoded JWT.
  • Invalid JWT: Returns a 401 Unauthorized response.

Try it at:

https://edgio-community-examples-v7-ef-jwt-validation-live.glb.edgio.link/jwt

Prerequisites

This JavaScript project requires:

Setup and Installation

  1. Ensure you meet the prerequisites.
  2. Clone the repository to your local machine.
  3. Run npm install in the repository directory.

Getting Started

After setting up the project, run npm run edgio:dev to start a local development server to test.

To deploy the project to Edgio, use the command npm run edgio:deploy. Deploying to Edgio requires you to be logged into Edgio CLI which can be done via npm run edgio login and the following the instructions.

Known Issues and Limitations

Edge functions:

  • Must use JavaScript code.
  • May only submit fetch requests to origins defined within your property configuration file (edgio.config.js).

View additional limitations.

Validating tokens signed with RSxxx, ESxxx, or PSxxx algorithms generally takes more processing power than is currently available for Edge Functions. Contact Edgio support to adjust the CPU and memory limits for your environment if you plan on validating these algorithms.

ESxxx algorithms use a very slow elliptical curve algorithm and may take longer than is allowed to validate, even with increased limits.

Support

If you have any queries or face issues with this project, contact us.

License

Creative Commons Attribution 4.0 International Public License for the documentation.

MIT License for the code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published