Content >

OAuth in Acumatica to Magento API Calls

OAuth in Acumatica to Magento API Calls

We have introduced OAuth-based authentication for Acumatica to Magento API calls instead of using Bearer Token.

OAuth is a widely used authentication protocol that allows users to grant limited access to their resources without sharing their credentials. It’s commonly used in scenarios where third-party applications need to access user data from a service whereas Bearer tokens are short-lived tokens issued by an authentication server. They are included in API requests’ headers and provide access if they are valid. Security measures like HTTPS are crucial when using bearer tokens to prevent interception.

In Magento, we have introduced the option to select OAuth in Acumatica Connection Settings. This configuration will be used for Acumatica Login.

Follow the steps:

  1. Log in to Magento with a valid credential.
  2. Once you logged in successfully to Magento click on the Kensium A-M Connector and click on Basic Configuration under Configuration.
Click on the Basic Configuration
Click on the Basic Configuration

You will be redirected to the following screen.

Select the Authentication type as Oauth 2 from the drop-down menu
Select the Authentication type as Oauth 2 from the drop-down menu.
  1. From the drop-down menu select Oauth2 instead of Login.
  2. Enter the Acumatica base URL. The Client ID, Client Secret, username, password and other relevant details will be generated from Acumatica. Once the Client ID and Cand client Secret ID are generated from Acumatica you need to copy and paste them into the respective field.

Login to Acumatica with valid credentials. After the successful login click on the [Integration] from the left panel as shown below. Under the Preferences on the Integration page, you will have the option for [Connected Application].

Connected Applications under Preferences in Integration
Connected Applications under Preferences in Integration

On the connected application the following details are available. Follow the steps as described.

  1. Client ID: This is system-generated.
  2. Client Name: Select the Client Name.
  3. Active: The option should be checked.
  4. Flow: Select the flow from the drop-down as [Resource Owner Password Credential]. The application will provide you with other flows as well.
  5. Add Shared Secrets: You need to click on Add Shared Secrets. A [Value] will be created by the application. Simply copy the value and paste it into the [Description] field. After completing this process, it will be displayed in the grid.

Adding shared secret
Adding shared secret

Shared secret on the grid
Shared secret on the grid.

Now, you need to go back to Magento and enter all the details like client ID, Client Secret, Acumatica URL, password, and other details.