5 (100%) 1 vote

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!

How to Use all Commands in Magento 2 CLI - Magento 2.3
How to Set up Multiple Websites with Apache - Magento 2.3