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
Excursionist
19 0 3

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)