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.

1 Answer 1


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.

  • Please mark the answer as accepted if it solved your issue. Aug 27, 2018 at 21:38

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.