Search code examples
blazor.net-6.0shopify-appshopifysharp

Shopify SignIn trouble - embedded app does not login properly


There is something I am stuck with, I have developed a Blazor application on .NET 6 that runs perfectly both locally and in production. It is being used at the moment outside of Shopify, however, I also need it to allow users to install it as an embedded app on Shopify and use it. I am using ShopifySharp to integrate with Shopify.

The first interaction - User installs, chooses their settings and auto logs in. This works, I have checked the tables necessary on the db and all info is saved.

However, when the user tries to use the app from inside the admin portal, via the app index (which I have configured to load the login page if it is from a domain we recognize) The app refuses to stay logged in. It does log in, shows a flash of the home page then immediately kicks the user out. I have tried fiddling with the cookie settings in the startup file which are currently set to Lax, i.e. options.SameSite = SameSiteMode.Lax; I'm not sure what else to change or what else I could try. Could someone point me in the right direction? The app communicates with our db and ShopifySharp successfully. So I don't see why it kicks the user out only on the admin portal. I will provide code snippets as they are required.


Solution

  • Turns out it was a setting on their admin portal, to determine if the app is embedded on a store or not, turning this off did the trick.