Step-by-Step Guide: Setting Up Magento 2 OAuth 1.0 Integration with Postman

Getting Started:

Magento has established itself as the leading platform for building robust and scalable online stores in the world of e-commerce. Magento provides online merchants with the tools they need to succeed in the digital marketplace with its extensive set of features and flexibility. One of the key aspects of Magento is its OAuth 1.0 Authentication Protocol, which helps ensure that different applications communicate with each other in a secure manner. In this blog post, we will use Postman, a popular API testing and development tool, to explore how to connect Magento 2 OAuth 1.0.

OAuth 1.0 Understanding:

OAuth (Open Authorization) is an open standard protocol. It provides secure and delegated access to protected resources. It allows users to grant third-party applications limited access to their resources without sharing their credentials. OAuth 1.0 uses a signature-based method to authenticate requests and is the predecessor to OAuth 2.0.

Magento 2 OAuth 1.0 setup:

To get started, you’ll need a running Magento 2 installation. Here are the steps to set up Magento 2 OAuth 1.0:

  1. Create a new consumer: In your Magento admin panel, navigate to "System" → "Extensions" → "Integrations". Click on "Add New Integration" and provide the necessary details such as the integration name, callback URL and permissions.
Step 1
Step 2
Step 3
  1. Generate OAuth credentials: Once the integration is created, Magento 2 will generate the OAuth credentials, including the consumer key and secret. Make sure you store these credentials securely.
Step 1
Step 2
Step 3

Postman Configuration:

Postman simplifies the process of developing and testing APIs. To configure Postman for Magento OAuth 1.0, follow these steps

  1. Install and run Postman: Download and install Postman on your system. Launch the application to continue.
  2. Create a new request: Click on the 'New' button in the Postman interface to create new 'HTTP Request'.
Step 1
  1. Set up the OAuth 1.0 authorisation:
  • Enter the request URL: Enter the endpoint URL of the Magento API you wish to interact with.
Step 1
  • In the 'Authorisation' tab, select 'OAuth 1.0' as the type.
  • Enter the Magento OAuth 1.0 credentials you have previously obtained: Consumer key, Consumer secret, Access token and Token Secret.
Step 1
  1. Submit the request: Click the Send button to execute the request. Postman will automatically handle the OAuth 1.0 signature generation and authentication process.
Step 1

API Reference

Get Product by sku

  GET /rest/V1/products/{{sku}}
ParameterTypeDescription
{{sku}}stringProduct sku
Step 1

Get Customer by id

  GET /rest/V1/customers/{{customer_id}}
ParameterTypeDescription
{{customer_id}}intCustomer ID
Step 1

Get Order by id

  GET /rest/V1/orders/{{order_id}}
ParameterTypeDescription
{{order_id}}intOrder ID
Step 1

For more detailed information on additional API endpoints, you can refer to the Magento documentation using the link below: https://developer.adobe.com/commerce/webapi/rest/quick-reference/

Leave a Reply

Your email address will not be published. Required fields are marked *