Skip to content

quest is not authorized. #10

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

Open
Micky79NRW opened this issue Jul 21, 2019 · 4 comments
Open

quest is not authorized. #10

Micky79NRW opened this issue Jul 21, 2019 · 4 comments

Comments

@Micky79NRW
Copy link

Hi,

I installed http_to_mqtt in a docker container with this image: https://github.com/MiGoller/docker-http-mqtt-bridge

Startup looks fine:
2019-07-21T16:07:44: PM2 log: Launching in no daemon mode
2019-07-21T16:07:44: PM2 log: App [HTTP-To-MQTT-Bridge:0] starting in -fork mode-
2019-07-21T16:07:44: PM2 log: App [HTTP-To-MQTT-Bridge:0] online
Node app is running on port 5000

but if I post a message I get this error:

Received request [/post] from [::ffff:192.168.xxx.xxx].
quest is not authorized.

Do you have any idea what this problem is?

Best regards from Germany
Michael

@robdejonge
Copy link

robdejonge commented Jul 31, 2020

When you send the request, make sure you pass along the key.

For example,
curl -H "Content-Type: application/json" "http://localhost:5000/post" -d '{"topic" : "MyTopic", "message" : "Hello World", "key" : "THE_AUTH_KEY_YOU_SET_WHEN_YOU_LAUNCHED_THE_CONTAINER"}'

@innesleroux
Copy link

Hi

I get it to work using above example and curl no problem. How would I use it in a browser by just typing the http?

Example:

http://192.168.1.65:5000/post?topic=cmnd/lamp/power&message=1&key=secretkey123

but all i get is:

Cannot GET /post?topic=cmnd/lamp/power&message=1&key=secretkey123

Please help!

Thanks

@petkov
Copy link
Owner

petkov commented May 4, 2021

This is a HTTP POST request, you can't do that by typing this URL in the browser.

@petkov
Copy link
Owner

petkov commented May 4, 2021

Try changing line 110 in index.js to app.get

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

4 participants