Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

[Odoo 19] Google OAuth — Fresh Install Still Stuck in Redirect Loop (/web/login ↔ /auth_oauth/signin)

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
1 Rispondi
736 Visualizzazioni
Avatar
Roger

✅ Environment

  • Odoo version: 19 (Enterprise / Community, same behavior)
  • Deployment: Self-hosted via Docker
  • Database: PostgreSQL 15 / 16
  • OS: Ubuntu 24.04 LTS
  • Python: 3.11
  • Reverse proxy: Nginx

location / { proxy_pass http://127.0.0.1:8069; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }

🧪 Reproducible on a Brand-New Server (No Legacy Data)

  • Fresh Ubuntu 24.04 VPS
  • Installed using the official script:
    wget -O - https://nightly.odoo.com/odoo.sh | bash
  • Only module enabled: auth_oauth
  • Google OAuth configured from scratch with valid credentials

Results:

  • http://localhost:8069 → ✅ Works perfectly
  • https://mydomain.com (with Let's Encrypt & proxy) → 🔁 Infinite redirect loop

🧩 Symptoms

  1. Click “Login with Google”
  2. Google consent → success
  3. Redirects back to Odoo → infinite loop:

    /web/login → /auth_oauth/signin → /web/login?redirect=/web → ...

  4. Browser DevTools shows multiple 302 redirects
  5. Sometimes appears as:
    • “Invalid Credentials”
    • “CSRF cookie not set”

🔍 Odoo Log Extracts

2025-10-28 14:xx:xx,xxx WARNING ? werkzeug: Invalid OAuth2 token 2025-10-28 14:xx:xx,xxx INFO ? odoo.addons.auth_oauth.controllers.main: OAuth2 callback: code received 2025-10-28 14:xx:xx,xxx ERROR ? odoo.addons.auth_oauth.controllers.main: Failed to fetch user info: 401 Unauthorized

⚙️ Google Cloud OAuth Config

  • Authorized redirect URIs:

    https://mydomain.com/auth_oauth/signin http://localhost:8069/auth_oauth/signin

  • APIs enabled: People API, OAuth consent screen: External (Published)

⚙️ Odoo Provider Settings

FieldValue
NameGoogle
FlowOAuth 2.0
Client IDxxxxxxx.apps.googleusercontent.com
Scopeopenid email profile
Authorization URLhttps://accounts.google.com/o/oauth2/auth
Token URLhttps://oauth2.googleapis.com/token
User Info URLhttps://www.googleapis.com/oauth2/v3/userinfo

🧪 Things Already Tried (All Failed)

  • ✅ web.base.url = https://mydomain.com + web.base.url.freeze = True
  • ✅ proxy_mode = True
  • ✅ Cleared all auth_oauth.google* from ir.config_parameter
  • ✅ Reinstalled auth_oauth
  • ✅ Disabled Cloudflare proxy
  • ✅ Created new domain + new Google project + new credentials
  • ✅ Works perfectly on localhost (HTTP)
  • ❌ Fails on HTTPS (any domain or Odoo.sh)

🧭 Key Findings

  • http://localhost:8069 → 100% success
  • https://... → 100% loop
  • Postman manual flow can successfully exchange code → id_token + access_token
  • _auth_oauth_signin() in auth_oauth/controllers/main.py line ~98 returns False
  • Log shows 401 Unauthorized from userinfo endpoint

❓ Questions for the Community

  1. Did something change in Odoo 18+ regarding Google id_token validation? (sub vs user_id?)
  2. Is web.base.url still being overridden even when frozen?
  3. Are extra “Allowed Domains” or CORS settings now required for OAuth?
  4. Does anyone have a working Google OAuth config (2025-tested) for Odoo 19 under HTTPS?

💡 Additional Clues

  • When enabling debug logging in auth_oauth, the callback works up to token exchange but fails when Odoo tries to fetch user info.
  • Same issue occurs even on a minimal installation with only auth_oauth, no custom modules, no cache, no proxy cache.
  • Appears identical across Odoo 18 nightly and 19 stable builds.

🧩 Hypothesis

It seems HTTPS reverse proxy environments fail to preserve proper protocol/host headers for Odoo’s OAuth state verification or Secure cookies, causing session mismatch → redirect loop.

But I’ve also seen 401 from userinfo endpoint even with valid access token — possibly due to missing Authorization: Bearer header.

🙏 Looking for

  • Any confirmed working Odoo 19 Google OAuth setup under HTTPS
  • Or a patch / commit referencing this regression in recent versions

Would appreciate if Odoo team or community could reproduce this cleanly on a fresh Docker setup — it’s 100% reproducible here.

0
Avatar
Abbandona
Avatar
Phillipp Hughes
Risposta migliore

Just an idea / hint.
I had similar behavior when enabling OAuth for Azure SSO.
Fixed it by

a) enabling some headers on my nginx, mentioned in https://www.odoo.com/documentation/18.0/administration/on_premise/deploy.html?highlight=nginx#id8 and

b) setting the not-self-explaining systemparameter auth_oauth.authorization_header as mentioned in the docs: https://www.odoo.com/documentation/18.0/applications/general/users/azure.html


but itsounds more likely, that you messed up with your nginx.conf

0
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now