Google and Facebook WiFi Login: OAuth, CNA, and Redirects

· Login Methods and Device Guides

How Social Login Works on Captive Portals

Retailers, cafes, shopping centers, restaurants, and conference venues frequently enable Google OAuth and Facebook Login to give guests one-tap WiFi onboarding without typing lengthy forms. Unlike a standard public website, however, a captive portal operates before the visitor receives full internet access. Until RADIUS authorizes the session, the guest device can reach only explicitly permitted destinations inside the router's walled garden.

Consequently, reliable social authentication depends equally on production configuration inside provider developer consoles and precise walled garden rules at the network edge. You can review the broader integration ecosystem on the Hotspotly integrations page before configuring individual providers.

Google Cloud Console External and In Production Requirements

To support Google Sign-In on a captive portal, administrators register an OAuth 2.0 web application inside Google Cloud Console and enter the generated Client ID and Client Secret into Hotspotly. In real deployments, most login failures stem not from invalid secrets, but from incomplete OAuth consent screen publishing settings.

First, the OAuth consent screen User Type is configured as External; selecting internal restricts authentication solely to users inside your own Google Workspace organization. Second, the Publishing Status switches from Testing to In production. While an app remains in testing mode, only manually listed test accounts can sign in, causing ordinary venue guests to see an access-blocked message. Complete field-by-field instructions appear in the Google login setup guide.

Testing Mode Limits and Redirect URI Matching

Within Google Cloud credentials, the Authorized redirect URI matches the exact callback endpoint served by your dedicated guest portal domain. Each component—the https scheme, exact hostname, and callback path without stray trailing slashes—is evaluated closely by Google's OAuth server. Entering the management console origin instead of the portal origin or introducing a path difference triggers a redirect_uri_mismatch error.

Facebook Login and Live Mode in the Meta Developer Dashboard

Configuring Facebook Login involves creating an app in the Meta for Developers dashboard, enabling the Facebook Login product, and copying the App ID and App Secret into Hotspotly. Similar to Google Cloud, switching the application mode from Development to Live lets external guests authenticate cleanly.

When an application stays in Development mode, external visitors receive an error stating the app is unavailable or restricted to developer accounts. Confirm that the Valid OAuth Redirect URIs list contains the exact HTTPS callback URL for your portal origin, and verify that the configured privacy policy links and app settings are completed. Detailed steps are covered in the Facebook login documentation.

Walled Garden Domain Allowlists and Callback Flow

Because unauthenticated guests have no unrestricted internet routing yet, the MikroTik router permits traffic to Google and Meta authentication endpoints, script assets, and essential CDN hosts before login succeeds. On provisioned MikroTik routers, Hotspotly updates walled garden rules automatically when social login methods are active. If your branch also sits behind an external firewall or inline proxy, verify that those upstream devices do not intercept or block social authentication domains prior to RADIUS approval.

Administrators should also keep OAuth scopes minimal, requesting only basic profile and email fields needed for identification rather than broad permissions that trigger extra review delays. In multi-branch deployments sharing a single central portal origin, one properly published Google and Meta app can serve multiple venues consistently, reducing the maintenance burden of duplicating OAuth credentials per branch.

Handling disallowed_useragent in Mobile CNA Environments

One of the most common surprises during captive portal testing occurs when Google OAuth works smoothly on a laptop browser yet fails inside the automatic popup window on smartphones. Both iOS Captive Network Assistant (CNA) and Android's built-in captive portal sheet operate inside constrained embedded webviews rather than full system browsers.

To reduce phishing and session hijacking risks inside embedded webviews, Google enforces a policy blocking OAuth requests from those user agents and returns a disallowed_useragent (403) error. Facebook Login can also encounter cookie persistence or popup restrictions across certain mobile webview builds. This behavior is an intentional upstream browser policy rather than a misconfigured Client Secret.

Full Browser Handoff and Troubleshooting Checks

To handle mobile CNA restrictions cleanly, portals guide guests to open the login page in their full system browser—such as Safari or Chrome—or apply compatible CNA handoff settings alongside properly populated walled garden rules and accurate NTP time synchronization. Once a guest switches out of the restricted CNA popup into a standard mobile browser, OAuth cookies persist reliably and callback redirects complete without triggering disallowed_useragent blocks. Practical diagnostic steps for CNA popups and callback failures are outlined in the troubleshooting FAQ guide.

Provider Production Console State Mobile CNA Behavior Primary Misconfiguration Cause
Google OAuth External + In production Embedded webview triggers disallowed_useragent Redirect URI mismatch or consent screen still in Testing
Facebook Login Live mode enabled Depends on walled garden and full browser consistency App left in Development mode or missing callback URI

Checklist for Avoiding redirect_uri_mismatch Errors

Before rolling out social login across live guest venues, verify four deployment checks to avoid callback mismatches:

  1. Use the portal domain: Register callbacks pointing to the guest portal domain rather than the administrative panel domain.
  2. Copy callbacks verbatim: Paste the exact callback URL provided in Hotspotly settings into Google Cloud and Meta without adding or removing trailing slashes.
  3. Enforce valid HTTPS: Confirm that TLS certificates and HTTPS routing on the portal domain validate cleanly without mixed-content redirects.
  4. Sync custom domain changes: Whenever you migrate a venue to a custom portal domain, update all registered OAuth redirect URIs across both provider consoles at the same time.

Separating Social Authentication from Optional Marketing Consent

Hotspotly does not treat display name or email attributes received via OAuth as marketing opt-in; by design, the portal separates terms and privacy notices from optional marketing consent checkboxes and leaves promotional opt-in unchecked by default.

Guests remain free to complete Google or Facebook WiFi authentication without opting into commercial messages, preserving transparent user choice. Privacy and consent rules vary by country (such as GDPR in Europe or KVKK in Türkiye), and this technical walkthrough of Google OAuth and Facebook Login configuration does not constitute legal advice; consult your own legal counsel and local legal advisor regarding regional consent language prior to launch.

All posts