Overview
The Google Login Plugin adds Sign in with Google (OAuth 2.0) to your Blesta client portal. Clients can log in with their Google account instead of a separate password — no new accounts needed, no password resets.
Version 2.0 uses the OAuth 2.0 Authorization Code flow with PKCE, a secure server-side implementation that replaces the deprecated Google Identity Services (GSI) JavaScript widget.
Requirements
- Blesta 5.x or later
- PHP 8.2 or later
- A Google Cloud Console project with OAuth 2.0 credentials
Step 1 — Set Up Google Cloud Console
- Go to Google Cloud Console
- Create a new project (or select an existing one)
- In the left menu, go to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Choose Web application as the application type
- Add your domain to Authorised JavaScript origins:
https://your-domain.com
- Add the following to Authorised redirect URIs:
https://your-domain.com/cp/plugin/google_login/
Replace your-domain.com with your actual domain. If Blesta is not at /cp/, adjust accordingly.
- Click Create and note your Client ID and Client Secret
Step 2 — Install the Plugin
- Download the plugin from your FXRM account
- Extract the
google_login folder into your Blesta plugins directory:
/path/to/blesta/plugins/google_login/
- Log into your Blesta admin panel
- Go to Settings → Company → Plugins
- Find Google Login Plugin and click Install
Step 3 — Configure the Plugin
- After installation, click Manage next to the plugin
- Enter your Client ID from Google Cloud Console
- Enter your Client Secret from Google Cloud Console
- Click Save
Step 4 — Test the Login
- Open your Blesta client portal in an incognito/private browser window
- You should see a Sign in with Google button on the login page
- Click the button — you will be redirected to Google to authorise
- After authorising, you will be redirected back and logged in
Note: The Google account's email address must match a registered client account in Blesta. If no matching account is found, login will be rejected with an error message.
How It Works
- Client clicks Sign in with Google
- They are redirected to
/cp/plugin/google_login/
- The plugin generates a PKCE code verifier and CSRF state token, stores them in session
- Client is redirected to Google's OAuth authorisation screen
- After Google authorisation, the client is redirected back to your Blesta install
- The plugin validates the state token, exchanges the authorisation code for tokens using PKCE
- Google's ID token is verified and the email address is extracted
- Blesta looks up the client by email address and creates a session
- The client is redirected to their dashboard