Hello everyone. REST API is very common in Magento 2. To send the request to Rest, it needs the resource to give the permission to access the data or process the logic code.

In this blog, I will show you how to rewrite the REST authentication. So you can create your custom authentication. (Magento <= 2.1.2)

  • First, please create di.xml file:

  • After that, please create the file to handle the rewrite:

Please write the code to check permissions in the //todo.

After that, please refresh the cache to make it work.

The steps I mention above is the shortest process for you to Override REST Authentication in Magento 2.

Thank you for reading this post and see you in other posts from Magestore!

 


Ready to foster your knowledge

with MAGENTO 2 BASIC GUIDE

Is your site still a mess and Magento extensions are not enough to save your site? Save your site with Magento Web Development Services now

magento services


How to Use All Commands in Magento 2 CLI (Part 10)
How to Set up Multiple Websites with Apache

Leave a Reply

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