Odoo with Google reCAPTCHA Keys
- Bernard Bryan Hayashi
- 3 hours ago
- 1 min read
CAPTCHA is a security service from Google that protects websites from bots and automated abuse. In simple terms, it helps websites check “Are you a real human or a bot?”
How it works
When you visit a website and try to:
submit a form
log in
create an account
post a comment
In Odoo, to enhance the security login to the portal or odoo backend login, you can get this Google reCaptcha

Navigate to Odoo reCAPTCHA setting
Enable and click “generate reCAPTCHA keys”

Fill in the google reCAPTCHA page

Wait for keys to be generated, copy keys to Odoo
Save Settings in Odoo page
Note: there may be delay of up to 30 minutes before captcha is working properly. Until then, captcha will automatically succeed
(Optional) Change reCAPTCHA security

Code Changes for Login Captcha
1. Settings to toggle on/off reCAPTCHA

2. Inherit login controller
If reCAPTCHA is setup, get response from reCAPTCHA frontend (JS Function) and send request to Google’s reCAPTCHA API to verify. If successful, proceed with original odoo login function, else redirect back to login page with captcha error message

3. Inherit Login XML – add reCAPTCHA widget and script to disable login

reCAPTCHA Preview





Comments