Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to Saleor – Invalid Token Error #16

Open
przwr opened this issue Jan 24, 2022 · 4 comments
Open

Connecting to Saleor – Invalid Token Error #16

przwr opened this issue Jan 24, 2022 · 4 comments

Comments

@przwr
Copy link

przwr commented Jan 24, 2022

For three days now I'm trying to connect this framework with saleor-platform. I constantly getting response from GraphQL that token is invalid.

The only way to install this app for me is to run install_app on saleor platform – it always fails on creating webhooks, but then I can click retry on the Dashboard and then it works. However trying to /products/ on complex app always fails with the same problem as creating webhooks – saleor responds that token is invalid. The same happends if I try to validate token on GrapQL Playground.

This token was generated a minute ago and not working.

What am I doing wrong? It seems like saleor-platform and this saleor-app-framework-python not working toghether.

When I try to install_app

on saleor-platform:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://{IP}:5000/configuration/install

on saleor-app-framework-python

INFO:     13.53.139.222:44186 - "GET /configuration/manifest/ HTTP/1.1" 307 Temporary Redirect
INFO:     13.53.139.222:44186 - "GET /configuration/manifest HTTP/1.1" 200 OK
INFO:     13.53.139.222:44190 - "GET /configuration/manifest/ HTTP/1.1" 307 Temporary Redirect
INFO:     13.53.139.222:44190 - "GET /configuration/manifest HTTP/1.1" 200 OK
Error when executing a GraphQL call to Saleor
Unable to finish installation of app for 13.53.139.222:8000.
INFO:     13.53.139.222:44192 - "POST /configuration/install HTTP/1.1" 403 Forbidden

Trying to create_app

on saleor-platform:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://{IP}:5000/configuration/install

on saleor-app-framework-python:

INFO:     13.53.139.222:44202 - "POST /configuration/install/ HTTP/1.1" 307 Temporary Redirect
Error when executing a GraphQL call to Saleor
Unable to finish installation of app for 13.53.139.222:8000.
INFO:     13.53.139.222:44202 - "POST /configuration/install HTTP/1.1" 403 Forbidden

This is what I get on /products on saleor-app-framework-python side after install_app and retry on Dashboard:

Provided X-SALEOR-DOMAIN and X-SALEOR-TOKEN are incorrect.
INFO:     192.168.0.11:53856 - "GET /products/ HTTP/1.1" 400 Bad Request

It there anything I can do to fix this?

@pkucmus
Copy link
Collaborator

pkucmus commented Jan 25, 2022

I will add a logger that should be there anyways to help us debug, but before that please tell me which Saleor version are you using?

@przwr
Copy link
Author

przwr commented Jan 26, 2022

I've tried 3.0 and the one that is on main branch – on both is the same problem.

@pkucmus
Copy link
Collaborator

pkucmus commented Jan 31, 2022

The logger is (was) there. Please set the saleor_app.install logger to DEBUG and check for the list of GraphQL errors.

@artursmet
Copy link
Contributor

@wrobelp I was facing the same issue, I figured out that saleor's install_app utility by default makes the tokens inactive.

When I was using ./manage.py install_app https://my-domain.com/app-manifest - I received 403s all the time, however once I did ./manage.py install_app https://my-domain.com/app-manifest --activate - everything worked just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants