"Unauthorized" error when authorizing the connection to Salesforce

 Problem

At the moment of authorizing the connection between Confluence Cloud and Salesforce for the initial configuration of the app, the following error appears on the Salesforce login:

The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.

 Solution

This issue is primarily caused since the browser is blocking third-party cookies, causing the authorization process to be interrupted due to Confluence credentials not being stored on the browser.

To fix the issue, you can follow the steps below, depending on the browser you are using.

Google Chrome

  1. At the top right, click More (→ Settings.

  2. Click Privacy and security → Third-party cookies.

  3. Ensure that the Allow third-party cookies option is enabled.

Firefox

  1. Click on the Menu button → Settings.

  2. Go to Privacy & Security on the left panel.

  3. Under Enhanced Tracking Protection, select Standard.

Alternatively, you can select Custom, making sure that the Cookies parameter is unchecked.

Safari

  1. Go to Safari → Preferences.

  2. Click on the Privacy tab.

  3. Ensure that Prevent cross-site tracking is disabled.

 

Must mention as well, that authorizing with incognito mode may lead to the same error, since privacy modes blocks third-party cookies by default.