Errore 500 dopo aver ottenuto il token nel plugin oauth2-basic

Sto riscontrando un errore strano che altri sembrano aver risolto. In sostanza, ricevo il token dall’API ma non vengono effettuate chiamate API per i dettagli dell’utente. Invece, l’URL di callback fallisce con 500 senza alcun messaggio di errore.

Dai log,

OAuth2 Debugging: response status 200

From POST https://developer-dev.api.autodesk.com/authentication/v2/token

Headers:
--- !ruby/hash-with-ivars:Faraday::Utils::Headers
ivars:
  :@names:
    user-agent: User-Agent
    content-type: Content-Type
    authorization: Authorization
elements:
  User-Agent: Faraday v2.14.0
  Content-Type: application/x-www-form-urlencoded
  Authorization: Basic xxx


Body:
--- '{"access_token":"xxxx","token_type":"Bearer","expires_in":3599,"refresh_token":"xxxx"}

  '

Processing by Users::OmniauthCallbacksController#complete as HTML
  Parameters: {"code"=>"xxx", "state"=>"d77d766602c9302ad6967569883d4c41ef0ac9847d0b85f8", "provider"=>"oauth2_basic"}
OAuth2 Debugging:       after_authenticate response:

      creds:
      ---
token: xxx
refresh_token: xxx
expires_at: 1767886006
expires: true


      uid:

      info:
      ---
name:


      extra:
      --- {}


Completed 500 Internal Server Error in 81ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.0ms)

Non ricevo alcun errore. Quindi non sono sicuro di cosa stia causando il problema. Ho verificato di aver impostato OAuth2 fetch user details, OAuth2 user JSON URL e OAuth2 JSON user ID path, ecc., ma non vedo alcuna chiamata API ai dettagli dell’utente in fase di esecuzione.

Qualsiasi informazione sarebbe molto apprezzata

Ho accesso sia al server che a Docker, comunque. Qualsiasi debug da provare, posso tentare.