0

I'm trying to customize the Magento API Engine 2. I would like to know if there is any time of the request, before arriving at webapi.xml to capture the token that came through the head and send it to a function that I created myself? If yes, how and where can I do this?

2
  • $this->userContext->getUserId(); from this vendor/magento/module-webapi/Controller/Rest/ParamOverriderCustomerId.php Commented Jun 1, 2019 at 10:23
  • From above you can fetch Token Commented Jun 1, 2019 at 10:23

1 Answer 1

0

I found a possibility:

use Magento\Framework\Webapi\Rest\Request;

$header = $this->request->getHeader('Authorization');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.