1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

doc

How to install the JWT solution through Azion Marketplace

Overview

JWT is a serverless solution available at Azion Marketplace.

Access tokens are often used to control access to online resources, such as APIs and media archives, and JSON Web Tokens (JWTs) can be used to simplify this process. However, JWTs can be larger than session IDs and affect network speed. You can solve this issues by using edge computing capabilities.

Azion offers a solution for increased security: the JWT Edge solution runs directly on the edge firewall. This solution allows you to grant and revoke privileges using KIDs and secrets, and set expiration dates. It runs on the edge for added security as it verifies authenticity before reaching the infrastructure, without the need to contact an authenticator server, which speeds up the process.


  1. Getting the JWT solution from Azion Marketplace
  2. Using the solution
    2.1 Setting up the Edge Firewall rule
    2.2 Setting up the Edge Firewall function
  3. Setting up the Edge Firewall Rules Engine

1. Getting the JWT solution from Azion Marketplace

To use the JWT solution provided by Azion’s Marketplace, follow these steps:

  1. Access Real-Time Manager (RTM) and log in.
  2. On the upper-left corner of the page, select Products menu > Marketplace.
  3. On Marketplace’s homepage, in the search box, type “JWT” or browse through the cards below it to find the desired JWT solution.
  4. Select the JWT card to be redirected to the homepage of the solution.
  5. On the Subscribe for section at the bottom-right corner of the page, click the Get It Now button.

A successful message will appear. Now, your solution is installed and ready to use.


2. Using the solution

2.1. Setting up the Edge Firewall rule

To instantiate the JWT Edge Function, follow these steps:

  1. On the Products menu, select Edge Firewall in the SECURE section.
  2. Click the Add Rule Set button.
  3. Give a name to your new rule.
  4. Select the domains you want to protect with the JWT Edge Function.
  5. Click the Function switch to enable functions on your edge application.
  6. Click the Save button.

2.2 Setting up the Edge Firewall function

To instantiate the JWT solution, while still on the Edge Firewall page, go to the Functions tab and follow these steps:

  1. Click the Add Function button.
  2. Give a name to your instance.
  3. On the dropdown menu, select JWT.

This will load the function, showing a for with the source-code of the solution and two tabs: Code and Args.

If you click on the Code tab, you can navigate through the source-code to become familiar with it, but without making changes. On the Args tab, you can change the configuration of your JWT function.

Select the Args tab to open the form for the JSON Args where you can add the parameters to execute your application.

The Args tab will load a example of KIDs, similar to the one below:

[{
  “kids”: {
    4546D4AA7F62F01A833A7ABE354030E7": “D6CB2342E44EFB6DD628276F36DA2359”,
    “D6CB2342E44EFB6DD628276F36DA2359": 60BD8ED7A768E8BD6925BEB0A691AADB”,
    60BD8ED7A768E8BD6925BEB0A691AADB”: 4546D4AA7F62F01A833A7ABE354030E7
  }
}]

To save your KIDs, click the Save button.

Done. Now you have your JWT instanced.


3. Setting up the Edge Firewall Rules Engine

To finish, you have to set up the Rules Engine in order to configure the behavior and the criteria to run the JWT.

To do this, follow these steps:

  1. Click the New Rule button.
  2. Give a name to the rule.
  3. Select a criteria to run catch the domain that will run the solution. For example: if Hostname is equal xxxxxxxxxxxx.map.azionedge.net.
  4. Below, select a behavior to the criteria. In this case, it’ll be Run Function.
    • Select the adequate JWT function according to the name you gave it in the instantiate step.
  5. Click the Save button.

Done. Now you have a JWT solution running for every request made to the domain you indicate.


You can see a use case by visiting the Setting up a paywall with Edge Function JWT page.


Didn’t find what you were looking for? Open a support ticket.