Git Product home page Git Product logo

Comments (8)

tanema avatar tanema commented on July 30, 2024 1

The issue is you need an SSL certificate to make request.

This is more easily done with a tunnel like ngrok

from shopify_django_app.

hin7141 avatar hin7141 commented on July 30, 2024

same here. Did you manage to fix it? @nachoggg

from shopify_django_app.

tanema avatar tanema commented on July 30, 2024

You will need to check the exception that is raised during the finalize action in shopify_app/views.py

from shopify_django_app.

rx-gan avatar rx-gan commented on July 30, 2024

Problem solved. You need to install the Python SSL certificate in order to get the access token from Shopify.
Read: https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate

Or you can try breaking the finalize function up to debug the problem yourself if it doesn't work.
Raise an exception at the right place to find the main issue. Mine was missing SSL certificate.

try:
        shop_url = params['shop']
    except Exception:
        messages.error(request, "Cannot get shop url")
        return redirect(reverse(login))

    try:
        session = _new_session(shop_url)
    except Exception:
        messages.error(request, "cannot create new session with shop url")
        return redirect(reverse(login))

    try: 
        access_token = session.request_token(request.GET.dict()) 
    except Exception:
        messages.error(request, request.GET)
        raise Exception('cannot get token')
        return redirect(reverse(login)) 

    try:
        request.session['shopify'] = {
            "shop_url": shop_url,
            "access_token": access_token
        }
    except Exception:
        messages.error(request, "cannot store session")
        return redirect(reverse(login))

from shopify_django_app.

ivanadamovic avatar ivanadamovic commented on July 30, 2024

In shopfify_app/decorators.py, I found this is true when the request is
/?hmac=6949885b8cdc92ca58b6f1bc74703ccc0d249165c078f9d07ad1a2d8a8b13c93&locale=en&new_design_language=true&session=5dd637ab8a0854360df8a3b4549e1527092942e40511615d819d3cb9c23b86ab&shop=demo.myshopify.com&timestamp=1609956648

if not hasattr(request, 'session') or 'shopify' not in request.session:

That's why it redirects the login page.
But not sure what the solution is.
Anyone can help us to fix this?

Thanks.

from shopify_django_app.

ivanadamovic avatar ivanadamovic commented on July 30, 2024

@nachoggg @hin7141 Were you able to fix the issues?

from shopify_django_app.

hin7141 avatar hin7141 commented on July 30, 2024

Hi @ivanadamovic . I managed to fix it. The issue is you need an SSL certificate to make request.

from shopify_django_app.

ivanadamovic avatar ivanadamovic commented on July 30, 2024

Hi @tanema, thanks for your answer.
I have tried using Ngrok but I am having the same issue.

My App URL

https://a725f8e7655c.ngrok.io/

Redirect URLs

https://a725f8e7655c.ngrok.io/shopify/finalize/
http://a725f8e7655c.ngrok.io/shopify/finalize/

Could you please help me fix this issue?
Thanks.

from shopify_django_app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.