Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

401 unauthorized #371

Closed
maruf-cefalo opened this issue Jan 15, 2020 · 4 comments
Closed

401 unauthorized #371

maruf-cefalo opened this issue Jan 15, 2020 · 4 comments
Assignees

Comments

@maruf-cefalo
Copy link

Case #1:
I have created a Route::post('/webhook/orders/create') in my api and in the shopify shop settings/notifications have created a webhook using url myngrokurl/api/webhook/orders/create in
such case the webhook is sending the test data. Have listed the route in the api to avoid csrf issue. But working fine as expected.

Case #2 : Problem is:
have created a webhook as documented

[
            'topic' => env('SHOPIFY_WEBHOOK_1_TOPIC', 'orders/create'),
            'address' => env('SHOPIFY_WEBHOOK_1_ADDRESS', env('APP_URL') . '/webhook/orders-create')
]

where env('APP_URL') is my ngrok url created and the jobs are crated as well.

but when i create an order in the shopify admin manually not from the notification area, this is the response I am getting

POST /webhook/orders-create 401 Unauthorized

Please help

@maruf-cefalo maruf-cefalo changed the title 404 unauthorized 401 unauthorized Jan 15, 2020
@maruf-cefalo
Copy link
Author

@ohmybrew can you please help

@anhnt1-hblab
Copy link

@ohmybrew I'm having exactly the same issue

@Kyon147
Copy link
Collaborator

Kyon147 commented Feb 17, 2020

The one thing I would make sure is the APP_URL needs to be an external domain, so it should not be https://localhost as Shopify will not be able to access that.

You need to make it whatever you login route faces, to https://myappurl.com/webhook/app-uninstalled

By default, you will probably have your local URL or 127.0.0.1 both which won't face externally.

Note: I had problems with it when using Ngrok, so you would need to try it on an actual server.

@anhnt1-hblab
Copy link

@Kyon147 oh, thanks. I try it now

@gnikyt gnikyt added the pre-v11 label Mar 17, 2020
@gnikyt gnikyt self-assigned this Mar 17, 2020
@gnikyt gnikyt closed this as completed Mar 17, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants