How to setup Magento 2 as an OAuth server?


(Dmitry Fedyuk) #1

Step 1

Open the «System» → «Extensions» → «Integrations» backend’s sidebar menu item:

Step 2

The «Integrations» list will be shown. Press the «Add New Integration» button:

Step 3

The «New Integration» screen will be shown.
Set tne integration «Name» and other settings, then specify your Magento 2 backend password in the «Your Password» field:

Step 4

Switch to the «API» sidebar tab and select the resources which will be available to OAuth clients:

Step 5

Press the «Save» button. The integration will be saved and the «Integrations» list will be shown again.
Press the «Activate» link in the integration row:

Step 6

A confirmation screen will be shown. Press the «Allow» button:

Step 7

The credentials screen will be shown.
Use them in your third-party software to access your Magento 2 as OAuth server.
You will see:

  • «Consumer Key»
  • «Consumer Secret»
  • «Access Token»
  • «Access Token Secret»

Copy it to somethere, then press the «Done» button.

Step 8

The integration will be saved and the «Integrations» list will be shown again.
You will see your integration in the «Active» state:

"Consumer is not authorized to access %resources"
How to update products stock from an external PHP file
(Joaquín Aldunate) #2

I saw this because I’m trying to do an app based on a magento site products list; but the system menu doesn’t have the “integrations” button in the case of this site for some reason. I don’t have any experience on Magento, I only want to enable some sort of access to the whole products list in XML or JSON without security risks, of course.