saleor-app-framework-python icon indicating copy to clipboard operation
saleor-app-framework-python copied to clipboard

Connecting to Saleor – Invalid Token Error

Open przwr opened this issue 3 years ago • 4 comments

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?

przwr avatar Jan 24 '22 15:01 przwr

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?

pkucmus avatar Jan 25 '22 09:01 pkucmus

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

przwr avatar Jan 26 '22 09:01 przwr

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

pkucmus avatar Jan 31 '22 21:01 pkucmus

@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.

artursmet avatar Feb 06 '22 19:02 artursmet