# jwt-provider

Con jwt-provider generamos el Json Web Token\
Abrimos el proyecto JWT Provider que crea un token jwt del usuario indicado.

![](/files/-LvqYXH-UwPfDTzW0b11)

dar clic derecho Build para generar el archivo .war

![](/files/-LvqZ6iwGgoY24HYHmFm)

### Ahora lo agregamos a Applications de Payara

![](/files/-LvqZGwcEuX4jty2ylJL)

dar clic en Deploy

Seleccionar el archivo war o pegar la ruta

![](/files/-LvqZWhkVgxZYc8vSJdU)

Ingresamos al browser

```bash
http://localhost:8080/jwt-provider/auth
```

![](/files/-LvqermOh19yT0WAsc4o)

Instalaremos httpie en Ubuntu

```bash
sudo apt-get install httpie
```

Ejecutamos

```bash
http --form :8080/jwt-provider/auth username=user1 password=user1
```

Nos muestra el token generado

![](/files/-LvsAH1syPrBr-1wLveg)

También podemos probarlo con curl

```bash
sudo apt-get install curl
```

```bash
curl -X POST http://localhost:8080/jwt-provider/auth -d "username=user1&password=user1"

```

Genera la salida

![](/files/-LvsAhXllIoxIW3cvLJf)

### Para probar el JWT

Ingresar

```bash
https://jwt.io/
```

Pegar el JWT generado

![](/files/-LvuTYb7ZsyNnKn1Hlg7)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/payaramicro/payara-con-jwt/jwt-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
