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

Http ACL auth doesn't work #176

Open
DeadL1ne opened this issue Jan 23, 2020 · 3 comments
Open

Http ACL auth doesn't work #176

DeadL1ne opened this issue Jan 23, 2020 · 3 comments
Assignees
Labels

Comments

@DeadL1ne
Copy link

Hi!
I do all the same that has been written in the documentation. Simple http auth is work fine, but when I try to use http ACL auth - it doesn't work for me, despite the fact that settings are very close. When I try to refer to the broker via Eclipse Paho I get the error with status code 3 that means the broker isn't available. I turned on emqx_auth_http from dashboard. This is my EMQX settings for http ACL auth:
emqx.conf

allow_anonymous = false
listener.tcp.external = 1884

plugins/emqx_auth_http.conf

auth.http.auth_req = http://127.0.0.1:8991/mqtt/auth
auth.http.auth_req.method = post
auth.http.auth_req.params = clientid=%c,username=%u,password=%P

auth.http.super_req = http://somesite.com/mqtt/superuser
auth.http.super_req.method = post
auth.http.super_req.params = clientid=%c,username=%u

auth.http.acl_req = http://somesite/mqtt/acl
auth.http.acl_req.method = post
auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t,mountpoint=%m

auth.http.request.retry_times = 3
auth.http.request.retry_interval = 1s
auth.http.request.retry_backoff = 2.0

Endpoints(http://somesite.com/mqtt/superuser, http://somesite/mqtt/acl) are working fine and I can get access to it from Postaman app. May be you could tell me where I do something wrong in my configuration or somewhere else?

@zhengyupan
Copy link

Hi @DeadL1ne
Are the endpoints accessible from out side? If possible, could you give me the endpoints so that I can have a try. please email me: zhengyu.pan_AT_emqx.io

@DeadL1ne
Copy link
Author

Hi @zhengyupan sorry for late reply
The endpoins are accessible from outside. I figured out with this problem but I don't know how. I've reinstalled broker and configure it with same properties and auth is working fine for now.

@HJianBo
Copy link
Member

HJianBo commented Feb 17, 2020

I think the previous configuration options is invalid if the http://127.0.0.1:8991/mqtt/auth is not available?:

auth.http.auth_req = http://127.0.0.1:8991/mqtt/auth
auth.http.auth_req.method = post
auth.http.auth_req.params = clientid=%c,username=%u,password=%P

@HJianBo HJianBo self-assigned this Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants