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 17 Microsoft SSO oauth Integration

Iscriviti

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

La domanda è stata contrassegnata
oauthssomicrosoftoauth2Controller
3969 Visualizzazioni
Avatar
Abhinav Bajimaya


I am trying to integrate microsoft azure with Odoo. I think all the keys through the azure portal is configured correctly.  "client id and client secret"

Ive managed to get the sign-in with Microsoft button on the login page. On clicking it, the page is redirected to '/authorize' page where you enter the username and password. 

Microsoft then redirects to this link GET on /microsoft_sso_integration/microsoft?code=something&state="something", which is all good according to the docs.

The problem is that  the query parameters here are not accessible through the *kw args. 
I try to check the kw value, but it returns empty when clearly it should be the code and state value returned by Microsoft.

This breaks the entire login flow of the code and I cant seem to figure out whats wrong here.

here is the auth controller 

class MicrosoftRoute(http.Controller):

  •     @http.route('/microsoft_sso_integration/microsoft', type='http', auth='none')
  •     @fragment_to_query_string    
  •     def azure_return(self, **kw):   
  •         state = json.loads(kw['state'])
  •         # make sure request.session.db and state['d'] are the same,
  •         # update the session and retry the request otherwise
  •         dbname = state['d']
  •         if not http.db_filter([dbname]):
  •             return BadRequest()
  •         ensure_db(db=dbname)

  •         provider = state['p']
  •         request.update_context(**clean_context(state.get('c', {})))
  •         _logger.info('outside try block')
  •         try:
  •             # auth_oauth may create a new user, the commit makes it
  •             # visible to authenticate()'s own transaction below
  •             _, login, key = request.env['res.users'].with_user(SUPERUSER_ID).auth_oauth_microsoft(provider, kw)
  •             _logger.info(str(login) + ' ' + str(key) + ' ' + str(dbname))
  •             request.env.cr.commit()
  •             action = state.get('a')
  •             menu = state.get('m')
  •             
  •             redirect = werkzeug.urls.url_unquote_plus(state['r']) if state.get('r') else False
  •             url = '/web'
  •             if redirect:
  •                 url = redirect
  •             elif action:
  •                 url = '/web#action=%s' % action
  •             elif menu:
  •                 url = '/web#menu_id=%s' % menu
  •             _logger.info(str(dbname) + ' ' + str(login) + ' ' + str(key))
  •             pre_uid = request.session.authenticate(dbname, login, key)
  •             resp = request.redirect(_get_login_redirect_url(pre_uid, url), 303)
  •             resp.autocorrect_location_header = False

  •              # Since /web is hardcoded, verify user has right to land on it
  •             if werkzeug.urls.url_parse(resp.location).path == '/web' and not request.env.user._is_internal():
  •                 resp.location = '/'
  •             return resp
  •         except AttributeError:
  •             # auth_signup is not installed
  •             _logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,))
  •             url = "/web/login?oauth_error=1"
  •         except AccessDenied:
  •             # oauth credentials not valid, user could be on a temporary session
  •             _logger.info('OAuth2: access denied, redirect to main page in case a valid session exists, without setting cookies')
  •             url = "/web/login?oauth_error=3"
  •             redirect = werkzeug.utils.redirect(url, 303)
  •             redirect.autocorrect_location_header = False
  •             return redirect
  •         except Exception:
  •             # signup error
  •             _logger.exception("Exception during request handling")
  •             url = "/web/login?oauth_error=2"

  •         redirect = request.redirect(url, 303)
  •         redirect.autocorrect_location_header = False
  •         return redirect

      
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
Post correlati Risposte Visualizzazioni Attività
automatically create user for users logging in via single sign on
oauth sso oauth2 Oauth SSO
Avatar
0
lug 24
2747
Odoo OAuth (Lark SSO): How to Support Multiple Browser Logins Without Session Conflict?
development oauth sso
Avatar
0
giu 25
1207
Google oauth
oauth oauth2 googlelogin
Avatar
0
dic 23
2346
Unable to install "OAuth2 Authentication" addon - Parse error? Field "in_group_14" does not exist in model "res.users"?
authentication sso oauth2
Avatar
0
ott 21
4181
OAuth with OpenAM (SSO)
oauth sso OpenAm
Avatar
Avatar
2
mar 15
3796
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