ozzyonfire / shopify-next-app

Shopify app template on Next.js with app directory
https://shopify-next-app-six.vercel.app
MIT License
64 stars 7 forks source link

How to turn this app non-embedded #8

Open yant-ai opened 6 months ago

yant-ai commented 6 months ago

How to handle auth?

ozzyonfire commented 6 months ago

Here is an example repository that I spun up. https://github.com/ozzyonfire/shopify-app-next-external

The flow is like this:

The cookie session strategy is just an easy one that works, but you could do something similar with JWT.

yant-ai commented 6 months ago

This is awesome. Thank you so much. What would happen if we’re doing offline token access.

On Mar 7, 2024, at 11:44 AM, Matt Oskamp @.***> wrote:

Here is an example repository that I spun up. https://github.com/ozzyonfire/shopify-app-next-external

The flow is like this:

User is presented with a login screen Based on the myshopify.com url it kicks off authentication which redirects the user to their admin side If the user installs the app, they are redirected to the callback url In the callback route, the app saves the accessToken to the session and saves the session id in a cookie Now you can use the session cookie to pull out the accessToken and make calls to the users Shopify store via the API The cookie session strategy is just an easy one that works, but you could do something similar with JWT.

— Reply to this email directly, view it on GitHub https://github.com/ozzyonfire/shopify-next-app/issues/8#issuecomment-1984304218, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDVVVJQN67TOOTFKIPC33NLYXC7RJAVCNFSM6AAAAABEGOIZXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGMYDIMRRHA. You are receiving this because you authored the thread.

ozzyonfire commented 4 months ago

Can you send me a screenshot of the error? It may not directly handle the HMAC validation, but it shouldn't be too hard to implement

yant-ai commented 4 months ago

Hey Matt that is error.

The Hmac validation is working through your library I tested it through the shopify web hook trigger cli and it’s smooth. It’s only this automatic check that is not working.

On Apr 19, 2024, at 12:00 PM, Matt Oskamp @.***> wrote:

Can you send me a screenshot of the error? It may not directly handle the HMAC validation, but it shouldn't be too hard to implement

— Reply to this email directly, view it on GitHub https://github.com/ozzyonfire/shopify-next-app/issues/8#issuecomment-2067129775, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDVVVJVLDWUBIXP3MDJZ5PLY6FSTNAVCNFSM6AAAAABEGOIZXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGEZDSNZXGU. You are receiving this because you authored the thread.