$100 Website Offer

Get your personal website + domain for just $100.

Limited Time Offer!

Claim Your Website Now

How to Configure Google Login in flarum?

Using fof/oauth

To configure Google Login in Flarum using the FoF OAuth extension, follow the step-by-step instructions below. This guide assumes that you have already installed the FoF OAuth extension and have access to the Google Developer Console to create OAuth credentials.

Step 1: Install the FoF OAuth Extension

If you haven’t already installed the FoF OAuth extension, you can do so via Composer.

  1. SSH into your server where Flarum is installed and navigate to the Flarum root directory.
  2. Run the following command to install the FoF OAuth extension:

Run the following command to install the FoF OAuth extension:

composer require fof/oauth

Once the installation is complete, clear Flarum’s cache:

php flarum cache:clear
  1. Go to your Flarum Admin Panel (https://yourdomain.com/admin), navigate to the Extensions tab, and enable the FoF OAuth extension.

Step 2: Create Google OAuth Credentials

You need to create Google OAuth 2.0 credentials for your Flarum forum to enable Google login.

  1. Go to the Google API Console:
  2. Create a new project:
    • In the top-right corner, click the Project dropdown and select New Project.
    • Give your project a name (e.g., “Flarum Google Login”) and click Create.
  3. Enable the OAuth API:
    • In the API Library, search for “Google Identity Platform”.
    • Click Enable.
  4. Configure the OAuth Consent Screen:
    • Go to APIs & Services > OAuth Consent Screen on the left sidebar.
    • Choose External as the user type and click Create.
    • Fill out the required fields, such as App name, User support email, and your developer contact email.
    • Add scopes such as email and profile, which are needed to authenticate users.
    • Save the configuration.
  5. Create OAuth 2.0 Credentials:
    • Go to APIs & Services > Credentials, then click Create Credentials and choose OAuth 2.0 Client IDs.
    • Set the Application Type to Web Application.
    • In Authorized redirect URIs, add the following URL (replace yourdomain.com with your actual domain): https://yourdomain.com/auth/google/callback
    • Click Create and note down the Client ID and Client Secret that you receive, as you’ll need them for the next step.

Step 3: Configure Google Login in Flarum

Configure Google OAuth:

  • After installing the extension, go to your Flarum Admin Panel (https://yourdomain.com/admin).
  • Navigate to Extensions, find the FoF OAuth extension, and enable it.
  • Configure the OAuth credentials by going to Settings > Login Providers > Google OAuth and entering the Client ID and Client Secret you generated earlier from the Google Developer Console.

  1. Go to your Flarum Admin Panel:
    • Log in as an admin and navigate to the Settings page.
  2. Find the OAuth Providers Section:
    • Scroll down to the Login Providers section.
    • You should see the Google OAuth option provided by the FoF OAuth extension.
  3. Enter the Google OAuth Credentials:
    • Enter the Client ID and Client Secret you obtained from the Google Developer Console in the respective fields.
    • For the Redirect URL, it should be pre-configured as https://yourdomain.com/auth/google/callback.
  4. Save the Changes:
    • Click Save to apply the changes.

Step 4: Test the Google Login Integration

  1. Visit your Flarum Forum:
    • Go to your forum’s homepage (https://yourdomain.com).
  2. Click on “Login”:
    • On the login page, you should now see a Login with Google option.
  3. Test the Google Login:
    • Click Login with Google and try signing in using a Google account.
    • If everything is configured correctly, you should be able to log in using your Google credentials.

Related Posts

The Ultimate Website Development Roadmap for Startups and Small Businesses

Introduction For startups and small businesses, a digital footprint is no longer a luxury—it is the foundation of market credibility. A business website serves as a 24/7…

Read More

Choosing a Reliable Website Development Partner for Sustainable Business Growth

Introduction In today’s hyper-connected economy, a company’s digital storefront is often its single most critical point of consumer interaction. A website is no longer just a digital…

Read More

WP-CLI Complete Tutorial: How to Install It, Understand It, and Use the Most Important wp Commands

If you manage WordPress sites regularly, WP-CLI can save a ridiculous amount of time. Instead of clicking through the dashboard for every plugin, theme, database, or user…

Read More

Master Troubleshooting Guide: Flarum Google Login OAuth Issue on cPanel/Apache with WordPress Root Site

1. Environment Overview This guide is based on a real troubleshooting case where: 2. Original Problem Google login was enabled for Flarum using FoF OAuth. The login…

Read More

Simplifying the Search for Trusted Professionals Near Me

Introduction We live in an era where you can manage almost your entire life from a smartphone, yet finding reliable local help often feels stuck in the…

Read More

Complete AIOps Training Guide: Tools, Use Cases, Certification & Career Path

Modern enterprise infrastructure generates far more data than human operators can realistically process. A typical cloud-native architecture experiences hundreds of thousands of ephemeral events daily, leading to…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x