Menù

How to Fix a 403 Error When Customers Log in with Social Network Accounts

Using social login helps customers register and log in quickly, improving the shopping experience on your PrestaShop store. However, some users may encounter a 403 Forbidden error when trying to log in with their social accounts.

In this guide, we’ll explain why this issue occurs and how to fix it by checking and disabling ModSecurity on your hosting.

 

What causes the 403 error in Social Login?

A 403 Forbidden error means that the server is rejecting the request. When customers attempt to log in with their social accounts, this error can be caused by:

ModSecurity is enabled on your hosting

  • ModSecurity is a security module that blocks certain requests if it considers them suspicious.
  • Social login requests may be mistakenly flagged and blocked, resulting in the 403 Forbidden error.

 

Incorrect file permissions

The server may deny access if certain files or directories in your PrestaShop store have incorrect permissions.

 

Firewall or security plugin restrictions

Some firewalls or security plugins may also block social login requests.

 

How to check if ModSecurity is causing the issue

To determine if ModSecurity is blocking social login:

Step 1: Try logging in with a test account using a social network (e.g., Facebook, Google, X).

Step 2: If you receive a 403 error, check your hosting settings.

Step 3: Look for ModSecurity logs or ask your hosting provider if ModSecurity is enabled.

If ModSecurity is enabled, follow the instructions below to disable it.

 

How to disable ModSecurity

Depending on your hosting provider, you can disable ModSecurity in different ways:

Option 1: Disable ModSecurity from cPanel

  • Log in to your cPanel account.
  • Scroll down to the Security section and click ModSecurity.
  • Locate your domain and check if ModSecurity is enabled.
  • If it is enabled, click Disable.
  • Save the settings and try logging in with a social account again.

 

Option 2: Disable ModSecurity via .htaccess

If your hosting does not provide a ModSecurity control panel, you can try disabling it manually:

  • Access your website files via FTP or File Manager.
  • Locate the .htaccess file in the root directory of your PrestaShop store.
  • Open the .htaccess file and add the following line at the top:

SecFilterEngine Off

SecFilterScanPOST Off

  • Save the file and reload your website.

 

Option 3: Contact your hosting provider

If you don’t have access to disable ModSecurity, contact your hosting provider and request that they disable it for your domain.

 

Following these steps, you can fix the 403 Forbidden error and ensure that customers can log in with their social network accounts without issues.

Conteggio visualizzazioni articolo: 133 visualizzazioni