Solving a Real-Life Challenge - How OMH Enabled Google Authentication for WordPress on Non-GMS Devices


November 2 2023


At Open Mobile Hub (OMH), we’re often asked how our platform can be applied to resolve real-world problems faced by application developers. One such issue involves the integration of Google Authentication in non-Google Mobile Services (GMS) devices. In this article, we’ll share a success story that showcases how OMH stepped in to tackle this challenge and support WordPress, a globally renowned content management system.

WordPress - The World’s Leading CMS:

Before delving into the solution, it’s essential to understand the significance of WordPress. As the most widely used content management system (CMS) worldwide, it powers millions of websites. However, WordPress was grappling with a significant issue – Google Authentication on non-GMS devices wasn’t functioning as expected. This hurdle posed a potential setback for countless users and site owners.

The Google Authentication Conundrum:

At the core of this challenge lay Google Authentication, a cornerstone for securely accessing WordPress accounts. While this service flawlessly operated on devices integrated with Google Mobile Services, the same couldn’t be said for non-GMS devices. This discrepancy results in frequent authentication failures, hindering smooth user experience.


OMH’s Solution for WordPress:

WordPress needed a reliable solution to ensure that Google Authentication worked seamlessly across all devices, regardless of whether they were GMS or non-GMS. The OMH team took the challenge head-on, and we’re excited to share the results.

Introducing the OMH GitHub Repository for WordPress:

For transparency and ease of implementation, we’ve made the solution available on our GitHub repository. Developers and stakeholders can explore the sample code, access documentation, and understand how OMH bridged the gap for WordPress. It is important to note that while this solution demonstrates a viable approach, it has not yet been incorporated into the official WordPress codebase. The WordPress team will need to review, test, and potentially modify the solution before it can be officially integrated and made available to the wider WordPress community.

Steps to Resolve the Authentication Challenge:

In this article, we’ll guide you through the steps we took to address the Google Authentication limitations on non-GMS devices. Our primary aim was to demonstrate how straightforward it can be to adapt WordPress, ensuring its Google Authentication functionality remains consistent across diverse device ecosystems.

We believe that the WordPress case study is a testament to OMH’s practicality and its potential to address real-world challenges. By sharing this story, we hope to inspire developers and businesses to consider how OMH can empower their applications and provide a seamless user experience, regardless of the devices their users employ.

Code Deep Dive

Setting the Stage: Gradle Configuration

Before diving into the code, it’s crucial to set up your project to include the necessary dependencies for OMH. Add the following lines to your build.gradle file:

   // ... other configurations ...
        // Define your product flavors here
   dependencies {
        // ... other dependencies ...
        implementation ''

This configuration ensures that your project recognizes OMH and is ready to utilize its authentication capabilities.

Acquiring the OMH Client: Dependency Injection

To interact with OMH, you need an instance of OmhAuthClient. In a well-architected Android application, dependency injection is a preferred method to acquire such instances. Here’s how you can inject OmhAuthClient into your LoginActivity:

   public class LoginActivity extends AppCompatActivity {
   @Inject OmhAuthClient mOmhAuthClient;
   // ... rest of your code ...

Ensure that your activity is part of your dependency injection setup, typically using Dagger or Hilt, to inject the OmhAuthClient instance.

The Authentication Journey

With OMH configured and the client injected, let’s delve into the authentication flow.

1. onCreate: Initializing the Activity

   protected void onCreate(Bundle savedInstanceState) {
      super. onCreate(savedInstanceState);

      if (mOmhAuthClient.getUser() != null) {
      } else {

In onCreate, the activity checks if the user is already authenticated via OMH. If authenticated, it navigates directly to the logged-in state. Otherwise, it proceeds to check for Smart Lock credentials or initiate the login process.

2. checkSmartLockPasswordAndStartLogin: Handling Smart Lock Credentials

   private void checkSmartLockPasswordAndStartLogin() {
      // Initialize Smart Lock and check for saved credentials
      // ...

This method attempts to streamline the login process by checking for saved credentials. If none are found or the user opts not to use them, it falls back to the standard login process.

3. startLogin: Initiating the Login Process

   private void startLogin() {
      if (getLoginEmailFragment() != null) {
         return; // Login already in progress

      if (getLoginPrologueFragment() == null && getLoginPrologueRevampedFragment () == null) {
   LoginEmailFragment. TAG);
      } else {

Here, the app decides between continuing with the standard login flow or initiating the OMH login process, based on the visibility of prologue fragments.

4. startOmhLogin: Integrating OMH for Non-GMS Devices

   private void startOmhLogin() {
      Intent loginIntent = mOmhAuthClient.getLoginIntent();

This method is the crux of the OMH integration, allowing users on non-GMS devices to authenticate using their Google accounts.


OMH’s proposed collaboration with WordPress underscores our dedication to delivering versatile and robust solutions. We have submitted code changes for integration, aiming to enhance the user experience by ensuring seamless Google Authentication on WordPress across both GMS and non-GMS devices, irrespective of the device’s ecosystem. These contributions are currently under review, and we are eagerly awaiting their potential incorporation into the WordPress platform.

Stay tuned for more stories on how OMH continues to make a difference in the world of mobile applications and services.


Fork our samples and try them yourself.

Thank you for reading this OMH SDK article! We hope that you are enjoying this series. We are open to any open-source contributors of this project, please contact us at if you are interested in joining the unified mapping revolution now! For more insights into the philosophy behind OMH, visit our official website:

To get started, visit:

#openmobilehub #omh #wordpress