nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 309 forks source link

How to use an offline token? #973

Closed onyamegatron closed 9 months ago

onyamegatron commented 9 months ago

Essentially I have a custom app that I will distribute to a client, I want them to run the app almost indefinitely as it's used primarily for the webhooks.

I don't want to run into any authorisation issues once they have already been authenticated. I so far followed your handbook to create an app with working webhooks, but I fear that after a while the online token may expire and the webhook requests may come with 401 unauthorised.

Do you have any experience with using offline tokens? I'd really appreciate some help. Thanks!

nozzlegear commented 9 months ago

Sorry @onyamegatron, I meant to reply when I added those labels. Did you get this figured out? I believe offline access tokens are just the "regular" access tokens that are referred to throughout ShopifySharp's documentation. They don't ever expire unless the user uninstalls your app, which you'll need to set up webhooks to know about so you can delete the access token.

onyamegatron commented 9 months ago

Yes that was the conclusion, I realised that I had already been using offline tokens. Thanks