Issue with Mautic Integration in SuiteCRM : Unable to Obtain Access Token

Hello SuiteCRM Community,

I am experiencing an issue while attempting to integrate Mautic with SuiteCRM via SugarCRM. The connection seems to fail during the OAuth2 authentication process, specifically when trying to obtain the access token. I’ve attempted various configurations but haven’t been able to resolve the problem. I would appreciate any guidance or advice you can provide.

Here are the details about my setup and the issue:


System Information:

  • SuiteCRM Version: 8.7.1
  • Mautic Version: 5
  • PHP Version: 8.1.29
  • Database in Mautic:
    |Version|5.7.44|
    |Doctrine driver|pdo_mysql|
    |Doctrine database platform (automatically detected)|Doctrine\DBAL\Platforms\MySQL57Platform|
  • Access: I have admin rights, but not SSH access to the server.

Here is what I have already tried:

  1. In SuiteCRM, I configured the OAuth2 keys with the following in the OAuth Keys:
  • Created a proper Client ID and Client Secret with no special characters:
  • **Put the Client ID and Client Secret correctly into SugarCRM (I know that all the credentials I put in SugarCRM are correct, including using version 6.x/community).
  • **I also properly set up an External OAuth Provider and connection (But I’m not sure if my current authorize and access token URL’s are correct for my given setup).
  • My Current URL’s:
  • Authorize URL: https://my-site-url-base/index.php?entryPoint=oauth2&action=authorize
  • Access Token URL: https://my-site-url-base/index.php?entryPoint=oauth2&action=token
  • When I go to my Authorize URL in my browser, I get the following message on screen: There is no action by that name: authorize
  1. In Mautic, I followed the standard steps for integration by:
  • Entering SuiteCRM’s OAuth credentials (Client ID, Client Secret).
  1. When I click the “Authorize” button in Mautic, a window appears, but the process fails with the following error:
    "Authorization failed with the error message: There was an unknown error encountered when trying to obtain the access token."

Logs and Errors:

SuiteCRM Logs:

Sun Jan 19 02:25:22 2025 [57445][1][FATAL] The specified OAuth2 provider ‘’ is not supported or not properly configured

Sun Jan 19 03:01:20 2025 [57443][1][FATAL] Exception handling in /bitnami/suitecrm/public/legacy/include/MVC/Controller/SugarController.php:397

Sun Jan 19 03:01:20 2025 [57443][1][FATAL] Exception in Controller: Required options not defined: urlResourceOwnerDetails

Mautic Logs:

[2025-01-22T01:11:50.475724+00:00] mautic.WARNING: PHP Warning - file_put_contents(/var/www/html/var/cache/prod/lastUpdateCheck.txt): Failed to open stream: Permission denied - in file /var/www/html/docroot/app/bundles/CoreBundle/Helper/UpdateHelper.php - at line 154 {“hostname”:“102d7f0a9693”,“pid”:15432}
[2025-01-22T01:14:39.904830+00:00] mautic.ERROR: INTEGRATION ERROR: Sugarcrm - There was an unknown error encountered when trying to obtain the access token. {“hostname”:“102d7f0a9693”,“pid”:15435}


Troubleshooting Attempts:

Here’s what I’ve tried so far:

  1. Tried various URL formats from other discussions on SuiteCRM community website (Authorize URL, Access Token URL).
  2. Verified OAuth2 keys in SuiteCRM for accuracy.
  3. Searched SuiteCRM documentation and forums for similar issues.
  4. Checked SuiteCRM and Mautic logs.

Unfortunately, none of these efforts have resolved the issue for me.


Additional Notes:

I suspect the issue may be related to:

  • The token URL setup: (e.g., incorrect endpoint, missing configuration).
  • Redirect URI handling in SuiteCRM or Mautic.
  • Authentication mismatch: between the systems.

I would appreciate it if someone could confirm if my URLs for Authorization and Token are correctly configured and if there is anything else I’m missing to get this integration to work for me.

Thank you for your help!

There is code fix mentioned in this discussion.

There are no issues withe Matuic plugin (other than the small one noted in my guide). I have it working on many installations with SuiteCRM.

From what you describe above there are some more things you can try:

  1. Sounds like you have a permissions issue in Mautic, please reset your permissions.
  2. Mautic caches the login/password for SuiteCRM. If it fails once, you need to do a mautic:cache:clear before attempting again. Some times it’s helpful to switch it to the Version 7. Save the plugin. Flush the cache, re-open and then switch back to Version 6. I’ve experienced this problem when entering the wrong credentials the first time, it’s sometimes difficult to flush out. However, after a few attempts you will get it.
  3. In SuiteCRM 8.7 the URL for the V4_1 API is broken. It was at service/v4_1/rest.php, which is where the plugin looks for the login. In 8.7 it’s /legacy/service/v4_1/rest.php you’ll have to setup an .htaccess redirect and test the original URL resolves to the new URL.

I’ve done dozens of these. Let me know if you have further probelms.

I’m reaching out one last time regarding the Mautic and SugarCRM integration issue I’ve been encountering. I have followed the steps you have mentioned in previous posts, but now I am only getting the error in the Mautic logs: “Login attempt failed. Please check the username and password.”

I have already reset permissions, cleared cache in the Mautic root directory, and I have attempted multiple times switching from SugarCRM version 7, cleared the cache, and then switched over to version 6 with the correct credentials.

I have also verified that there is no firewall interfering with the integration.

Here is a screenshot for reference:

Mautic Log Errors:

[2025-01-26T23:07:21.906983+00:00] mautic.ERROR: INTEGRATION ERROR: Sugarcrm - Login attempt failed please check the username and password {“hostname”:“102d7f0a9693”,“pid”:764363}
[2025-01-26T23:09:48.807948+00:00] mautic.ERROR: INTEGRATION ERROR: Sugarcrm - Login attempt failed please check the username and password {“hostname”:“102d7f0a9693”,“pid”:71}

SuiteCRM Log Errors:

Sun Jan 26 23:09:48 2025 [57441][-none-][FATAL] FAILED LOGIN:attempts[1], ip[…], username[admin]
Sun Jan 26 23:09:48 2025 [57448][-none-][FATAL] SECURITY: User authentication for admin failed
Sun Jan 26 23:09:48 2025 [57448][-none-][FATAL] FAILED LOGIN:attempts[1], ip[…], username[admin]

I would appreciate any further advice or recommendations on how to continue to try to resolve this issue.

Thank you again for your help and time!

The only other thing I’ve ever run into is a firewall on the server blocking access to the login url.

Also from the error you show your permissions are incorrect. Mautic cannot write to the cache directory. This will also cause the login to fail because it stores the login info in the cache.