Is it possible to do a jwt authentication?

is it possible to do a jwt authentication? I want to be able to renew the token when it expires

on request failure I call this function, but not work :cry:

if([0].error == 'token expired' || ts_Token.value == null){
   Promise.resolve(generateToken.trigger()).then(data => {

Hi @leosantosx!

How is your resource authentication currently set up? How do you provision the tokens?

Hi @ben

/ POST https://example/authenticate
        "username": "value",
        "password": "value",

        "token": "value",
        "expiresIn": "value"

    / GET https://example/list-users
        "token": "value",
        "Content-Type": "application/json"

    response: list all users or message: "token expired"


how do i revalidate the token? :disappointed_relieved:

I see! If you define these requests inside the resource setup page - Retool will handle the authentication + refresh requests. There is an example of how to set this up in the Custom API Authentication docs

@ben Do you have an example (template)?

I'm not succeeding

@leosantosx can you share how you currently have this set up?

Uploading: Captura de tela 2021-06-23 110202.jpg...

it looks like you are setting the authentication inside the base request. But you need to add your token request to the auth section of the resource: