alesc
alesc

Reputation: 45

Shopware6 app integration with external application

We developed our Shopware6 app/plugin to create integration keys for our external application: our service offer a webapp (outside Shopware interface) to manage the orders and give some extra feature. Once the customer install our plugin from the shopware store, it successfully communicates with our server and creates the API key following the documentation flow shown here:

https://developer.shopware.com/docs/guides/plugins/apps/app-base-guide

We'd like to ask a question explaining our use case: the customer who install the plugin should be able to "import" those credentials into our app to enable our app to communicate with the store and call the shopware APIs.

The problem is that once the integration is created, on the admin panel the customer can't find anywhere any reference to the integration: not the API key, not the API secret, not the shopId. We have no reference to create into our systems a link of the created integration with a specific customer, to let him use the shopware APIs from our webapp interface. The only link available to us is the store domain, but being accessible to everyone on the internet we can't use it let the customer enable the integration over our system (anyone who'd try to input the store domain could use the store integration, even if the store is not his own).

What is the best way to link a shopware integration (created by an app installation) with an external application? Can some extra infos be added to the registration api (for example a one-time username/password) that can be used by the customer as input to enable the integration on our systems?

Upvotes: 0

Views: 159

Answers (1)

j_elfering
j_elfering

Reputation: 3190

It should not be necessary for the customer to manually "import" the credentials into your service as that should happen automatically during the app registration.

During the app registration your external service get's all relevant information e.g. access keys for the generated integration and the shopId etc. You should save those infos on app side so the customer does not need to copy that information manually.

What you would have to built would be a secure way to connect the account for your service with the correct shopware shop in a secure way. You can do that by providing configuration in your app where the customer can add credentials for your service and you use that to make the connection between both services. This currently is the preferred solution by shopware.

Or you build it in your side, there you actually could build a form that accepts any integration key, without any additional privileges, as you only need to verify that the customer actually is a admin for that shopware shop as well, when you verified that by making sure that you can e.g. access a basic api route of the shop you can then use the integration key that you got during the app registration for the shop running on that domain.

Sadly you have to build that manually, there is currently now automated way to connect shopware shops to other services by using a standard like OAuth or OpenId Connect.

Upvotes: 1

Related Questions