UI deve utilizar refresh_token quando o authorization expirar

Description

Problema


  • Estamos com logouts frequentes, gerando a necessidade de informar o 2FA frequentemente por usuários

Objetivo


  • FE deve, ao constatar que o token expirou, utilizar o refresh_token para gerar um novo Authorization e um novo refresh_token.

  • Endpoint:

curl -X 'POST' \  'https://poffo.carol.ai/api/v3/oauth2/token' \  -H 'accept: application/json' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -H 'Authorization: Bearer TOKEN' \  -d 'grant_type=refresh_token&refresh_token=REFRESH_TOKEN'

Retorno:

{  "access_token": "NOVO_TOKEN",  "client_id": "2552811ce1b8b801823184b935a6c4bf",  "expires_in": 3599,  "mfa_enabled": false,  "mfa_token": "",  "refresh_token": "NOVO_REFRESH",  "state": "",  "timeIssuedInMillis": 1764125836173,  "token_type": "bearer"}