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

UnauthorizedAccess when the user uninstalls app and visits app website for reinstall #37

Closed
ShahrukhAhmed89 opened this issue Jul 7, 2020 · 2 comments

Comments

@ShahrukhAhmed89
Copy link

ShahrukhAhmed89 commented Jul 7, 2020

I am testing a scenario where the user deletes the app from the app store and visits the app website for a reinstall. There's this error I am getting, which I think has to do with session cookies.

UnauthorizedAccess at /
Response(code=401, body="b'{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}'", headers={'Date': 'Tue, 07 Jul 2020 16:55:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': '__cfduid=d66d908e10629c9a0c4c68d2813a8ac3f1594140900; expires=Thu, 06-Aug-20 16:55:00 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax', 'X-Sorting-Hat-PodId': '81', 'X-Sorting-Hat-ShopId': '27194884178', 'Referrer-Policy': 'origin-when-cross-origin', 'X-Frame-Options': 'DENY', 'X-ShopId': '27194884178', 'X-ShardId': '81', 'WWW-Authenticate': 'Basic Realm="Shopify API Authentication"', 'Strict-Transport-Security': 'max-age=7889238', 'X-Request-Id': '6c55bc70-6f2d-42dd-9410-3871c8f11987', 'X-Shopify-Stage': 'production', 'Content-Security-Policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=show&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fshops&source%5Bsection%5D=admin_api&source%5Buuid%5D=6c55bc70-6f2d-42dd-9410-3871c8f11987", 'X-Content-Type-Options': 'nosniff', 'X-Download-Options': 'noopen', 'X-Permitted-Cross-Domain-Policies': 'none', 'X-XSS-Protection': '1; mode=block; report=/xss-report?source%5Baction%5D=show&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fshops&source%5Bsection%5D=admin_api&source%5Buuid%5D=6c55bc70-6f2d-42dd-9410-3871c8f11987', 'X-Dc': 'gcp-us-central1,gcp-us-central1', 'CF-Cache-Status': 'DYNAMIC', 'cf-request-id': '03cbccd3c50000cbfc1a3fa200000001', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '5af31732da15cbfc-SIN', 'alt-svc': 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400'}, msg="Unauthorized")
Exception Location: | myvenv\lib\site-packages\pyactiveresource\connection.py in _handle_error, line 415
myvenv\Scripts\python.exe

My question is, what's a good way to resolve this, probably clear session cookies, and send the user back to the install/root_path page?

@ShahrukhAhmed89 ShahrukhAhmed89 changed the title UnauthorizedAccess when the user uninstalls app and visits website UnauthorizedAccess when the user uninstalls app and visits app website for reinstall Jul 7, 2020
@ShahrukhAhmed89
Copy link
Author

It was the context_processor. Nevermind. :)

@shriDeveloper
Copy link

Hi @ShahrukhAhmed89 , Could you please elaborate on the same. I am facing the same issue.

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

2 participants