Happening now! Shopify Community AMA: Building a Marketing Budget with 2H Media | Ask your marketing budget questions now!

How to change Private Apps based Authentication to now support Apps based Authentication

How to change Private Apps based Authentication to now support Apps based Authentication

SuneelG
Shopify Partner
11 0 0

We had got some third party application developed  for Data exchange between our Shopify Store and our custom third party Apps. Shopify Store Admin Access was being done via Private Apps, which authenticated with Shopify Stores through basic HTTP authentication, using the URL format https://{apikey}:{password}@{hostname}/admin/api/{version}/{resource}.json

We needed to set up a new store and add the same functionality. However Shopify no longer allows for Private Apps to be developed/ installed, and therefore one needs to use that custom Apps. The custom Apps authentication  seems different. While we are able to generate the API keys/ token etc, we do not know the changes to be done to our code ( developed in Python using Python Shopify API)  for the store authentication. Can someone point me to any resources or examples on  how to Authenticate a store via Custom Apps for Store Admin API access ... and can we still continue to use the same Python API calls ?

Replies 2 (2)

SuneelG
Shopify Partner
11 0 0

I managed to figure out how to authenticate via custom Apps, but I'm not able to generate a session wise Access toke, Ive only been successfull using the Acces Token generated when I install the APp vai the Partner dashboard

SuneelG
Shopify Partner
11 0 0

There is a very useful Github article that shows how to authenticate and then access the APIs via custom or public Apps https://github.com/Shopify/shopify_python_api#public-and-custom-apps

But in that article I couldnt figure out where we are using the variaable 'state' referred to in the following line of code

 

state = binascii.b2a_hex(os.urandom(15)).decode("utf-8")

 

also unable to figure out where or how to define "request_params" which is used in the following line of code

 

access_token = session.request_token(request_params)