2

Is it possible to create and display a bearer token in my custom admin setting screen for my plugin?.

In short, I want to be able allow customer to install my plugin, copy a Bearer Token from the a settings page for my plugin and allow my external server to access to their Magento store view Magento's API interface given the Bearer token.

With Magento 1.x we were able to something like this, display a token from the admin page which then gave our external server access to their Magento site using the token.

2

You can use POST /V1/integration/admin/token API get bearer token for admin as mention in devdocs here.

But you'll need admin username and password which cannot be programatically fetched (well admin username can be from session, but not password).

So, you would have to make a dialogue asking for username and password and then you can generate bearer and show it to the user.

|improve this answer|||||
  • Please mark the answer as accepted if it solved your issue. – Vivek Kumar Aug 27 '18 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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