Protecting SynaMan's Login Page with Google reCAPTCHA

SynaMan supports Google reCAPTCHA on its login page, adding an invisible layer of bot protection that blocks automated credential-stuffing attacks without requiring your users to solve a puzzle.


What is reCAPTCHA and why does it matter?

Automated bots routinely try to break into web applications by cycling through millions of username and password combinations. Because SynaMan can be exposed to the internet for file sharing, it is an attractive target. Google reCAPTCHA silently scores every login attempt in the background and blocks requests that look machine-generated, without any visible friction for real users.

SynaMan supports both flavors of reCAPTCHA:

Edition Best for Requires a Google Cloud project?
reCAPTCHA (standard) Most deployments. Fast to set up using the Google reCAPTCHA Admin Console. No
reCAPTCHA Enterprise High-volume or compliance-sensitive deployments that need detailed risk scoring and audit logs. Yes
Invisible to your users. SynaMan uses the invisible reCAPTCHA (execute-on-submit) pattern. Users never see a checkbox or image challenge — verification happens automatically when the Login button is clicked.

Step 1 — Create reCAPTCHA credentials in Google

Standard reCAPTCHA

  1. Go to https://www.google.com/recaptcha/admin and sign in with a Google account.
  2. Click + Create and fill in a label (e.g. SynaMan Login).
  3. Under reCAPTCHA type, choose Score based (v3).
  4. Add every domain from which users will reach your SynaMan login page.
  5. Accept the terms and click Submit.
  6. Copy the Site key and Secret key shown on the next screen. You will need both when configuring SynaMan.

reCAPTCHA Enterprise

  1. Open the Google Cloud Console, select (or create) a project, and enable the reCAPTCHA Enterprise API.
  2. Navigate to Security → reCAPTCHA Enterprise and click Create key.
  3. Choose Website as the platform and add your domains.
  4. Note your Site key, the API key (used in place of the secret key), and your Google Cloud project ID.
Keep keys private. The secret key (or API key for Enterprise) must never be shared or embedded in client-side code. SynaMan stores it encrypted in AppConfig.xml and never sends it to the browser.

Step 2 — Configure SynaMan

  1. Log in to SynaMan as an administrator.
  2. Click the gear icon (or navigate to Administration → Configuration).
  3. Select the reCAPTCHA tab.
  4. Check Enable Google reCAPTCHA.
  5. If you registered an Enterprise key, also check Use reCAPTCHA Enterprise and enter the Google Cloud Project ID.
  6. Paste your Site Key and Secret Key (or API Key for Enterprise) into the corresponding fields.
  7. Click Save. The change takes effect immediately — no restart required.
Secret key masking. Once a secret key has been saved, the configuration page shows asterisks (**********) in that field rather than the real value. Leave the field unchanged when saving other settings — SynaMan will not overwrite the stored key with the placeholder.

Step 3 — Verify it is working

After saving, open the SynaMan login page. Right-click and choose View Page Source (or open the browser Developer Tools). You should see a <script> tag loading https://www.google.com/recaptcha/api.js?render=YOUR_SITE_KEY (or enterprise.js for the Enterprise edition). A successful login attempt will also include a hidden g-recaptcha-response parameter in the form submission.

If the reCAPTCHA score falls below Google's threshold, the login request is rejected with the message Recaptcha key is invalid and the event is logged. Legitimate users on a normal browser will never see this message.


Emergency bypass — disable_captcha.txt

If reCAPTCHA is misconfigured and nobody can log in, you can disable it for a single server startup without touching the database or configuration files:

  1. Create an empty file named disable_captcha.txt in the SynaMan working directory (the folder from which SynaMan was started).
  2. Restart SynaMan (or wait for the next request to be processed).
  3. SynaMan detects the file, disables reCAPTCHA for that run, and immediately deletes the file. reCAPTCHA will be active again on the next restart.
  4. While logged in, navigate to the reCAPTCHA configuration tab and correct the keys or uncheck Enable Google reCAPTCHA.
One-time use only. The bypass file is deleted the moment SynaMan reads it. It cannot be used to permanently disable reCAPTCHA, and no user action is required to re-enable protection after the file has been consumed.

Content Security Policy considerations

If your SynaMan deployment uses a strict Content Security Policy (CSP) header, the browser will block the Google reCAPTCHA script unless the policy explicitly allows it. SynaMan handles this automatically:

  • When reCAPTCHA is enabled, SynaMan adds https://www.google.com and https://www.gstatic.com to the script-src directive, and adds a frame-src https://www.google.com directive for the challenge iframe.
  • This applies to both the built-in CSP header (enabled with the use.content.security.policy.self system property) and any custom headers defined in config/CustomHttpHeaders.txt.

No manual changes to your CSP are needed; the adjustment is applied dynamically whenever reCAPTCHA is active.


Frequently asked questions

Will reCAPTCHA affect users on mobile devices?

No. SynaMan uses the invisible score-based reCAPTCHA v3 pattern. There is no visible widget or image challenge on any device. Mobile users log in exactly as they did before.

Does reCAPTCHA apply to the "Forgot your password?" flow?

Yes. When reCAPTCHA is enabled, SynaMan verifies a reCAPTCHA token before processing any password-reset request. This prevents bots from abusing the reset email endpoint to enumerate valid accounts or flood inboxes.

Can I use reCAPTCHA with Custom Branding?

Yes. The reCAPTCHA script tag and form integration are injected by SynaMan at the application level and are independent of the branding template. Ensure your CustomTemplate.htm includes Bootstrap JS so that the "Forgot your password?" modal dialog renders correctly.

Can I switch between standard and Enterprise reCAPTCHA?

Yes. Simply update the keys and toggle the Use reCAPTCHA Enterprise checkbox in the configuration tab, then click Save. The switch takes effect immediately without restarting SynaMan.

What score threshold does SynaMan use?

SynaMan delegates the pass/fail decision to Google's verifyCaptcha API. Google recommends treating scores below 0.5 as likely automated. Consult the reCAPTCHA v3 documentation for guidance on tuning the threshold for your user population.

Navigation

Social Media

Powered by 10MinutesWeb.com