# How to Install the JWT Integration

JWT is a *serverless* integration 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 these issues by using edge computing capabilities. 

Azion offers an integration for increased security: the JWT Edge integration runs directly on the firewall. This integration 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.

---

## Getting the JWT integration from Azion Marketplace

To use the **JWT** integration provided by Azion Marketplace, follow these steps:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace homepage, select the integration's card.
3. Once the integration's page opens, click the **Install** button.

A successful message will appear. Now, your integration is installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar.
:::

---

## Configuring the integration

### Setting up an firewall

To instantiate the JWT Function, follow these steps:

1. On the upper-left corner, open the **Products menu**, represented by three horizontal lines, then select **Firewall** in the **SECURE** section.
2. Click the **+ Firewall** button.
3. Give a name to your firewall.
4. Click the **Functions** switch.
5. Click the **Save** button.

### Setting up the Firewall function

To instantiate the JWT integration, while still on the **Firewall** page:

1. Go to the **Functions Instances** tab.
2. Click the **+ Function Instance** button.
3. Give a name to your instance.
4. On the dropdown menu, select **JWT**.
  - This action will load the **Arguments** tab.
5. On the **Arguments** tab, add the parameters.

The **Arguments** tab will load an example of KIDs, similar to the one below:

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

6. Click the **Save** button.

Done. Now you have your JWT instanced. 


### Setting up the Firewall Rules Engine

To finish, you have to set up the [Rules Engine](/en/documentation/products/secure/firewall/rules-engine/) to configure the behavior and the criteria to run the JWT.

To do so, still on the **Firewall** page, follow these steps:

1. Select the **Rules Engine** tab.
2. Click the **+ Rule Engine** button.
3. Give a name to the rule.
4. Select a *criteria* to run and catch the domains that you want to run the integration on.
  - Example: if `Host` *matches* `yourdomain.com`.
5. Below, select a *behavior* to the *criteria*. In this case, it'll be **Run Function**. 
    - Select the adequate function according to the name you gave it during the instantiation step.
6. Click the **Save** button.

On the Console, you must now configure your domain so your firewall protects it.

7. On the **Products menu**, select **Worloads**.
8. Click on the domain you want to protect with your JWT function.
9. In the **Settings** section, click on the `Firewall` selector and choose the firewall you created.
10. Click the **Save** button.

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

:::tip
You can see a use case by visiting the [Setting up a paywall with Function JWT](/en/documentation/products/guides/paywall-function-jwt/) page.
:::

---