Connecting a Magento Open Source or Mage-OS store with an integration access token
This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.
Distilled from Adobe’s own documentation, which covers Magento Open Source and Adobe Commerce together: Token-based authentication, Create an integration, Construct a request and the Admin guide’s Integrations. Retrieved 2026-09-08.
A Magento integration is the merchant-side object that issues a long-lived credential: “The merchant determines which Commerce resources the integration can access”, and its access token’s lifetime is “Indefinite. It lasts until it is manually revoked.”
Before you start: turn the bearer switch on
Section titled “Before you start: turn the bearer switch on”This is the step that makes everything else work, and skipping it looks exactly like a wrong token.
Sending an integration’s access token on its own as a bearer token is disabled by default: “In previous versions of Commerce, the access token could be used on its own for token-based authentication. This behavior has been disabled by default due to the security implications of a never-expiring access token.”
Restore it either in the Admin, at Stores > Configuration > Services > OAuth > Consumer Settings > Allow OAuth Access Tokens to be used as standalone Bearer tokens = Yes, or on the command line:
bin/magento config:set oauth/consumer/enable_integration_as_bearer 1Adobe does not recommend it — the alternative is signing every request as OAuth 1.0a with all four of the integration’s credentials — but it is the documented supported setting, and it is what a stored credential needs.
Create the integration
Section titled “Create the integration”- In the Admin, go to System > Extensions > Integrations, and click Add New Integration.
- On Integration Info, enter a Name and a contact Email. Leave Callback URL and Identity Link URL empty — those drive the OAuth 1.0a handshake, which this path does not use.
- Enter Your Password when prompted; the form confirms your admin identity before it will save.
- Open the API tab and set Resource Access.
Allis simplest;Customis better, and then tick at least the resources for what the integration will actually do:- Stores (
Magento_Backend::store) — needed by the connection check below. Tick it even if you only ever read products. - Catalog > Inventory > Products and Categories
(
Magento_Catalog::products,Magento_Catalog::categories) for catalog work. Magento does not separate read from write here: one tick grants both. - Sales for orders, and its children individually for invoicing
(
Magento_Sales::invoice), shipping (Magento_Sales::ship) and crediting — Sales does separate these, so ticking the parent alone is not enough. - Customers (
Magento_Customer::customer, andMagento_Customer::manageto change them).
- Stores (
- Click Save.
Activate it and copy the token
Section titled “Activate it and copy the token”- Back on the Integrations grid, find the new integration and click Activate.
- Review the API permissions in the popup and click Allow in the upper-right corner.
- Commerce shows the Integration Tokens for Extensions dialog with four values: Consumer Key, Consumer Secret, Access Token and Access Token Secret. Copy the Access Token — that is the only one this connection needs. Store the rest somewhere safe anyway; the dialog is your one chance at them.
- Click Done.
Fill in the connection
Section titled “Fill in the connection”- Access Token — the value from step 3.
- Store host — your store’s host, with no scheme and no trailing slash
(
shop.example.com), plus the subdirectory if the store is not installed at the root. - Store view code — the path segment every REST URL carries. Leave it at
defaultunless you mean a specific store view;defaultis “the default value when no store code is provided”.
Requests then go out as:
Authorization: Bearer <your Access Token>against https://<host>/rest/<store_code>/V1/... — for example
GET https://shop.example.com/rest/default/V1/products?searchCriteria[pageSize]=1.
If the connection check fails with 401
Section titled “If the connection check fails with 401”Read the message, not just the code. Commerce answers a bad token and a
good token without the right resource with the same HTTP 401 — internally
both an AuthenticationException and an AuthorizationException map to
HTTP_UNAUTHORIZED. A body saying “The consumer isn’t authorized to access
Magento_Backend::store” means the token is fine and the Resource Access list
is not; go back to the API tab, tick Stores, save, and Reauthorize.
Two other things produce the same 401 with a perfectly good token: the bearer switch at the top of this guide still being off, and the token having been replaced — reauthorizing an integration “generates a new Integration Access Token and Access Token Secret”, so the old one stops working the moment you widen its permissions.
Rotating and revoking
Section titled “Rotating and revoking”To rotate: find the integration with Active status and click Reauthorize in the Activate column, approve the resources again, and copy the new Access Token into the connection. To cut access off entirely, delete the integration in the Admin; the token dies with it, and there is no separate revocation call to make.
Mage-OS stores
Section titled “Mage-OS stores”Nothing above changes on Mage-OS. It is a distribution of the same codebase, described by its own association as an “upstream-compatible distribution built on top of Magento Open Source” that is “100% compatible with Magento Open Source extensions, themes, and integrations” and “maintains full database and API compatibility with Magento Open Source” (Mage-OS product page, retrieved 2026-09-08).
So: the same System > Extensions > Integrations screens, the same
oauth/consumer/enable_integration_as_bearer setting, the same
Authorization: Bearer header and the same /rest/<store_code>/V1 routes. Enter
your Mage-OS host as the Store host and everything else in this guide applies
word for word.
Connect it to Publicus
Section titled “Connect it to Publicus”Open Connections under Credentials, choose Magento Open Source / Mage-OS, and pick Magento Open Source / Mage-OS integration access token. Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.
See also: Magento Open Source / Mage-OS in the catalog.
This guide is maintained by Publicus and published under CC BY 4.0.