Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Directly call app backend #94

Open
bilobait-lohrmann opened this issue Oct 17, 2023 · 3 comments
Open

Directly call app backend #94

bilobait-lohrmann opened this issue Oct 17, 2023 · 3 comments

Comments

@bilobait-lohrmann
Copy link

Right now it is only possible to call the app backend via action buttons. Is it possible to call the app backend in a secure way as it is for the client side (shopware/shopware#3191)?

@seggewiss
Copy link
Contributor

Sorry that this went unnoticed for quiet some time. We'll check this ASAP and get back to you.

@jleifeld
Copy link
Contributor

jleifeld commented Mar 6, 2024

Hey @bilobait-lohrmann :)

I have a solution for you for this problem. If this fullfills your needs I would also write a documentation for this in the SDK. How it is working:

Your server delivers the html file for the iFrame. Every rendered iFrame has added the shop-id as a query parameter. You can get the token for this shop the same way as in the action buttons. Then you add your token inline into the HTML file as a global window variable and this token can then be used directly inside your JS code. A real life example can be found here: https://github.com/FriendsOfShopware/FroshAppWebDav/blob/main/src/handler.ts#L66

If this approach works for you then let me know and I would write a more detailed documentation for this 👍

@bilobait-lohrmann
Copy link
Author

Hi @jleifeld

sounds great. thank in advance for the documentation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants