2.6 KiB
2.6 KiB
Google Login & User Registration Implementation Plan
To allow users to seamlessly register, log in, and interact with the Wisdom1 site using their Google accounts, we will use a secure OAuth bridging plugin. This is the industry-standard approach for WordPress.
Recommended Plugin
Nextend Social Login and Register
- Free for Google integration.
- Highly secure (uses native Google OAuth 2.0).
- Does NOT store user passwords.
- Automatically creates a native WordPress "Subscriber" account upon first login, granting them permission to comment.
Step 1: Google Cloud Configuration (Manual Setup)
Before activating the plugin on the site, you must generate secure OAuth credentials from your Google account.
- Log into the Google Developer Console.
- Create a new Project (e.g., "Wisdom1 Auth").
- Navigate to APIs & Services > OAuth consent screen and configure it for "External" users.
- Navigate to Credentials > Create Credentials > OAuth client ID.
- Select Web application as the application type.
- Under Authorized redirect URIs, add the specific URL the Nextend plugin generates (this will be provided once the plugin is installed, typically
http://wisdom1.local/wp-login.php?loginSocial=google). - Once created, you will be provided a Client ID and a Client Secret. Keep these secure.
Step 2: WordPress Plugin Setup
- Install and activate the
nextend-facebook-connectplugin. - Navigate to Settings > Nextend Social Login.
- Enable the Google provider.
- Paste the Client ID and Client Secret generated in Step 1.
- Verify the connection through the plugin's test panel.
Step 3: Custom Theme Integration (Development)
Rather than relying on the plugin's default styling, we will seamlessly integrate the login flow into the wisdom1 theme's aesthetic.
Modifications Required:
comments.php:- Intercept the logged-out state.
- Replace the standard name/email/website form fields with a prominent, beautifully styled "Continue with Google" button.
- When clicked, this button will direct the user through the Google OAuth flow and redirect them back to the article, fully logged in.
functions.php:- Ensure the user's Google display name is correctly mapped to their WordPress display name so that comments render beautifully.
Verification
- Test clicking "Continue with Google" as a logged-out guest.
- Authenticate with a personal Google account.
- Verify that a new WordPress user is provisioned in the database.
- Verify the user is redirected back to the article and is able to leave a personalized comment.