E-commerce has become a requirement for all kinds of companies. Every web business owner is looking for a sophisticated business solution that offers scalability, flexibility, and scalability.
Magento 2 versions from 2.3 has a replacement for traditional install / upgrade schema which is used to maintain the database structure.
A website considered a great source of a marketing platform for a travel company. It is a place where you can share your availability and regularity all the time without unusual hindrances. A website should be responsive, user-friendly, and easy to operate. A travel company promotes itself through the best website to put trustworthy content. It may promote visitors and it would be a great platform to place tour packages.
Today Magento 2 has become one of the most widely and commonly used eCommerce development platform around the world. In this article:, we will learn about..
Interested to know how to access Magento 1.X REST and oAuth settings for REST API?
Read the article below...
Magento authentication is based on OAuth, an open standard for secure API authentication. It uses a token-passing mechanism that allows users to control which applications have access to their data without revealing their passwords or other credentials. This article helps you to get consumer key, consumer secret, oAuth token, oAuth token secret which are added as Authentication headers for accessing Magento REST API’s.
A customer who has an account with Magento and can use the services via the Magento API.
A third-party application that uses oAuth to access the Magento API. This application must be registered in the Magento system to receive the Consumer Key and Consumer Secret.
A value used by the Consumer to identify itself with Magento.
A secret used by the Consumer to guarantee the ownership of the Consumer Key. This value is not passed in requests.
A value used by the Consumer to obtain authorization from the User (when needed). The Request Token is exchanged for an Access Token when permission is granted.
A value used by the Consumer to call Magento APIs on behalf of the User.
System-> Web Services-> Rest oAuth Consumers-> Add New-> Enter the consumer information queried and password if probed. Save (Note down the consumer key and consumer secret)
Sample Response:
The authentication endpoints include the following steps:
All steps listed below are tested using REST CLIENTS such as MOZILLA REST CLIENT EXTENSION (Recommended), POSTMAN and ADVANCED REST CLIENT
oauth_token=ff1469e90aa*****868c8ed4865aa8ecb& oauth_token_secret=d11447b004681*****c86accae032cc4c& oauth_callback_confirmed=true
The below image shows generating temporary oAuth token and oAuth token secret
URL: http://your-url.com/admin/oauth_authorize?oauth_token=oauth_token received from above step
Running the url in your browser opens Magento admin panel. Login and then authorize the request.
Once authorized note down the URL in address bar:
https://yoururl.com/?oauth_token=1419892709e9941*******8d84d7f5bb5&oauth_verifier=613de3bf584d2***8c2dd2af4fb26c0
*oAuth_verifier is the required value.
Method: POST
URL: http://your-url.com/oauth/token?oauth_verifier=oauth_verifier from above step.
(Final permanent token and token secret to be used to access Magento Rest API Resources)
The above tokens are to be sent as Oauth1.0 Authorization Headers along Oauth_version as 1.0 and randomly generated nonce, timestamp and oauth_signature.
For example:
Method: GET
Url:http://your-url.com/api/rest/products
'content-type':'application/json'
Auth_headers:
'Authorization': 'OAuth oauth_signature_method="HMAC-SHA1",
oauth_nonce="rltCs",
oauth_timestamp="1533556177",
oauth_consumer_key="1cc517b6cb****597594c7fc5d57a596",
oauth_token="24471d629f7ce06ba****527fc5f520b4",
oauth_version="1.0",
oauth_signature="G0NsWh0BEeZh****wCY6xESrdfQ%3D"'
Note: nonce and timestamp are randomly generated unique values.
©2022 eGlobe IT Solutions. All Rights Reserved.
Leave a Reply