Divi Help Documentation by Gables Tech
Google log in limited-OAuth
Crear credenciales OAuth en Google Cloud
Crear credenciales OAuth en Google Cloud
Ve a Google Cloud Console → APIs y servicios → Credenciales. Crea un ‘ID de cliente OAuth 2.0’ tipo ‘Aplicación web’. Agrega como URI de redirección autorizada algo como https://tudominio.com/?google_callback=1. Guarda el Client ID y Client Secret.
(full control, without relying on a third-party plugin):
Create a file, read a file
Quick usage summary:
Upload the file to `/wp-content/mu-plugins/` (create the directory if it doesn’t exist)
Add your credentials and the list of allowed emails to `wp-config.php` (the lines are commented out at the top of the file)
Use `[google_login_boton]` on any page, or the link will appear automatically on `wp-login.php`
Key security points:
If the email isn’t on your whitelist, no account is created—the attempt is rejected with a clear message
Credentials are stored in `wp-config.php`, not in the theme code or the database
Uses a `state` parameter with a nonce to prevent CSRF attacks during the OAuth flow
You will now find the following under Settings → Login with Google:
A field to paste allowed email addresses (one per line)
A field for allowed domains (e.g., miagencia.com grants access to any email from that company)
A notification if Google credentials still need to be configured in wp-config.php
The login link, ready to copy and share with your clients
For security reasons, the credentials (Client ID/Secret) still go in wp-config.php, but you can now edit the list of authorized users directly from the WordPress dashboard, without touching any code.
Once you create the credentials using this, copy the Client ID and Client Secret and add them to your wp-config.php like this:
define('GOOGLE_OAUTH_CLIENT_ID', 'tu-client-id.apps.googleusercontent.com');
define('GOOGLE_OAUTH_CLIENT_SECRET', 'tu-client-secret');