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

**URL:** https://meta.discourse.org/t/500-error-after-getting-the-token-in-oauth2-basic-plugin/392974
**Category:** SSO
**Tags:** oauth2
**Created:** [8 Gennaio 2026, 2:38pm UTC](https://meta.discourse.org/t/500-error-after-getting-the-token-in-oauth2-basic-plugin/392974 "2026-01-08T14:38:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tejasj654](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tejasj654](https://meta.discourse.org/u/tejasj654)
#### Post date: [8 Gennaio 2026, 2:38pm UTC](https://meta.discourse.org/t/500-error-after-getting-the-token-in-oauth2-basic-plugin/392974/1 "2026-01-08T14:38:24Z")

</div>

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,

```plaintext
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

---

<div class="post-metadata">

### Author: ![tejasj654](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tejasj654](https://meta.discourse.org/u/tejasj654)
#### Post date: [8 Gennaio 2026, 2:40pm UTC](https://meta.discourse.org/t/500-error-after-getting-the-token-in-oauth2-basic-plugin/392974/2 "2026-01-08T14:40:32Z")

</div>

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