What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to get Shopify offline token for permanent access in Python Django

How to get Shopify offline token for permanent access in Python Django

salman116
Tourist
19 0 2

Hi, I built a public app and everything was working smoothly but all of a sudden my webhooks and other APIs started giving 
HTTP Error 401: Unauthorized b'{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}' for shopify . is there any expiry

 

This is happening for merchants and if I login my shop again via shopify then I get new shopify token and everything works but after 1 day or so this error starts coming again.

I did some RnD and got to know that there are 2 types of token .
i) Online token
ii) Offline Token

but how can I get this offline token,

These are my settings in django.

SOCIALACCOUNT_PROVIDERS = {
    "shopify": {
        "APP": {
            "client_id": os.getenv("SHOPIFY_API_KEY"),
            "secret": os.getenv("SHOPIFY_API_SECRET"),
            "key": "",
        },
        "SCOPE": ["read_orders", "read_customers", "write_customers", "write_discounts", "read_products", "read_returns"],
        "AUTH_PARAMS": {"grant_options[]": "per-user"},
    },

I am using AllAuth library in Django

Replies 0 (0)