Comments (8)
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.
same here. Did you manage to fix it? @nachoggg
from shopify_django_app.
You will need to check the exception that is raised during the finalize action in shopify_app/views.py
from shopify_django_app.
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.
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×tamp=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.
@nachoggg @hin7141 Were you able to fix the issues?
from shopify_django_app.
Hi @ivanadamovic . I managed to fix it. The issue is you need an SSL certificate to make request.
from shopify_django_app.
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)
- requirements.txt HOT 2
- Setup Environment HOT 1
- UnauthorizedAccess when the user uninstalls app and visits app website for reinstall HOT 2
- KeyError at /shopify/finalize/ 'shopify_oauth_state_param' HOT 1
- circular import error HOT 4
- Enhance README with steps to setup Shopify app via Iframe HOT 2
- Can you include the new authentication with session tokens? HOT 1
- KeyError at /shopify/finalize/ 'shopify_oauth_state_param' HOT 8
- Pure Noob Question about an error while first starting the app. HOT 2
- Authentication not working: 'no such table: django_session' HOT 1
- analytics app? HOT 6
- Can I still use request.session in Django for embedded apps? HOT 6
- Can I use Django async support to call Shopify API?
- How can I add a theme app extension to a Shopify app based on python django?
- UnauthorizedAccess when the user uninstalls the app HOT 2
- Can't find SHOPIFY_API_KEY and SHOPIFY_API_SECRET
- Emmbedded App: You're accessing the development server over HTTPS, but it only supports HTTP.
- Can't run pipenv install command
- Oauth error invalid_request: The redirect_uri and application url must have matching hosts HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify_django_app.