Knowledge Base

Getting Started

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

  1. Go to Google Cloud Console
  2. Create a new project (or select an existing one)
  3. In the left menu, go to APIs & Services → Credentials
  4. Click Create Credentials → OAuth 2.0 Client ID
  5. Choose Web application as the application type
  6. Add your domain to Authorised JavaScript origins:
    https://your-domain.com
  7. 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.

  8. Click Create and note your Client ID and Client Secret

Step 2 — Install the Plugin

  1. Download the plugin from your FXRM account
  2. Extract the google_login folder into your Blesta plugins directory:
    /path/to/blesta/plugins/google_login/
  3. Log into your Blesta admin panel
  4. Go to Settings → Company → Plugins
  5. Find Google Login Plugin and click Install

Step 3 — Configure the Plugin

  1. After installation, click Manage next to the plugin
  2. Enter your Client ID from Google Cloud Console
  3. Enter your Client Secret from Google Cloud Console
  4. Click Save

Step 4 — Test the Login

  1. Open your Blesta client portal in an incognito/private browser window
  2. You should see a Sign in with Google button on the login page
  3. Click the button — you will be redirected to Google to authorise
  4. 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

  1. Client clicks Sign in with Google
  2. They are redirected to /cp/plugin/google_login/
  3. The plugin generates a PKCE code verifier and CSRF state token, stores them in session
  4. Client is redirected to Google's OAuth authorisation screen
  5. After Google authorisation, the client is redirected back to your Blesta install
  6. The plugin validates the state token, exchanges the authorisation code for tokens using PKCE
  7. Google's ID token is verified and the email address is extracted
  8. Blesta looks up the client by email address and creates a session
  9. The client is redirected to their dashboard
Please rate this article to help us improve our Knowledge Base.

0 0