Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Issue

Connecting Salesforce with Magento (Steps 11 & 12 on the Salesforce To Magento Integration Setup page) work for most of the cases. If you are using custom domains for the Magento Admin Panel and your Storefront(s), you may encounter the following error if the connection is not configured properly.

Usecase 1

The screenshot below could be visible if you are already logged in to the Magento Admin Panel.

Usecase 2

You may also see this message if you have not logged into the Magento Admin Panel.

Why this is happening?

This issue is linked to the multi-domain setup, for example:

  • admin.mystore.com/admin - the backend area (Magento Admin Panel).

  • shop.mystore.com - the actual store your customers are visiting.

If you use shop.mystore.com in the Salesforce configuration when trying to connect to Magento - the issue described above will occur.

Technical details:

  1. You use the shop.mystore.com domain in your configuration

  2. Magento redirects you to the admin area authorization form

  3. You put login/password and click the “Login

  4. Magento receives this request, detects that you are trying to authenticate into Magento Admin Panel and forwards the request to the admin.mystore.com domain

  5. The Form Key in your request is valid only for the shop.mystore.com domain.

  6. As a result, you see the “Invalid form key“ error.

Solution

  1. Make sure admin.powersync.biz can receive requests

  2. Make sure the following URLs work and make sure they are not causing a redirect somewhere else:

    • https://admin.mystore.com/oauth/initiate

    • https://admin.mystore.com/admin/oauth_authorize

    • https://admin.mystore.com/oauth/token

  3. Use the admin.powersync.biz domain for the OAuth configuration in Salesforce. 

  • No labels