processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
250 stars 140 forks source link

ejabberd_auth_http is not updated to last ejabberd_auth API #230

Closed marcotuna closed 6 years ago

marcotuna commented 7 years ago

Hello, I configured ejabberd_auth_http however when I try to access IP:5280/admin it displays an error. Version: ejabberd-17.08 Operating System: FreeBSD 11.0-RELEASE-p1

2017-11-11 17:26:10.150 [info] <0.331.0>@ejabberd_listener:accept:302 (<0.494.0>) Accepted connection 192.168.45.254:13282 -> 192.168.45.7:5222
2017-11-11 17:26:10.243 [info] <0.331.0>@ejabberd_listener:accept:302 (<0.496.0>) Accepted connection 192.168.45.254:21591 -> 192.168.45.7:5222
2017-11-11 17:26:15.449 [info] <0.331.0>@ejabberd_listener:accept:302 (<0.498.0>) Accepted connection 192.168.45.254:45873 -> 192.168.45.7:5222
2017-11-11 17:26:16.162 [info] <0.333.0>@ejabberd_listener:accept:302 (<0.500.0>) Accepted connection 10.0.43.2:63169 -> 192.168.45.7:5280
2017-11-11 17:26:16.162 [info] <0.500.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.10711>}
2017-11-11 17:26:16.169 [info] <0.333.0>@ejabberd_listener:accept:302 (<0.501.0>) Accepted connection 10.0.43.2:49046 -> 192.168.45.7:5280
2017-11-11 17:26:16.169 [info] <0.501.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.10716>}
2017-11-11 17:26:29.608 [error] <0.500.0>@ejabberd_auth_http:existing_pool_name:255 CRASH REPORT Process <0.500.0> with 0 neighbours crashed with reason: bad argument in call to erlang:list_to_existing_atom("ejabberd_auth_http_192.168.45.7") in ejabberd_auth_http:existing_pool_name/1 line 255
2017-11-11 17:26:29.621 [info] <0.333.0>@ejabberd_listener:accept:302 (<0.502.0>) Accepted connection 10.0.43.2:39700 -> 192.168.45.7:5280
2017-11-11 17:26:29.621 [info] <0.502.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.10755>}
2017-11-11 17:26:29.638 [error] <0.502.0>@ejabberd_auth_http:existing_pool_name:255 CRASH REPORT Process <0.502.0> with 0 neighbours crashed with reason: bad argument in call to erlang:list_to_existing_atom("ejabberd_auth_http_192.168.45.7") in ejabberd_auth_http:existing_pool_name/1 line 255
2017-11-11 17:26:29.684 [info] <0.333.0>@ejabberd_listener:accept:302 (<0.503.0>) Accepted connection 10.0.43.2:46149 -> 192.168.45.7:5280
2017-11-11 17:26:29.684 [info] <0.503.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.10756>}
2017-11-11 17:26:29.690 [error] <0.503.0>@ejabberd_auth_http:existing_pool_name:255 CRASH REPORT Process <0.503.0> with 0 neighbours crashed with reason: bad argument in call to erlang:list_to_existing_atom("ejabberd_auth_http_192.168.45.7") in ejabberd_auth_http:existing_pool_name/1 line 255
2017-11-11 17:26:29.795 [info] <0.333.0>@ejabberd_listener:accept:302 (<0.504.0>) Accepted connection 10.0.43.2:53974 -> 192.168.45.7:5280
2017-11-11 17:26:29.795 [info] <0.504.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.10757>}
2017-11-11 17:26:29.803 [error] <0.504.0>@ejabberd_auth_http:existing_pool_name:255 CRASH REPORT Process <0.504.0> with 0 neighbours crashed with reason: bad argument in call to erlang:list_to_existing_atom("ejabberd_auth_http_192.168.45.7") in ejabberd_auth_http:existing_pool_name/1 line 255
badlop commented 7 years ago

It seems that you are trying to login using an account that is defined in a vhost where that auth wasn't started.

Show me:

marcotuna commented 7 years ago

I managed to solve that problem. I was missing the certificates configuration. Now it is reaching my API Server /api/ejabberd/get_password?user=username&server=server.com&pass= I tried to return status code 200, return true in the body, password but nothing seems to work. Is there any examples?

2017-11-13 11:39:35.204 [info] <0.6648.0>@ejabberd_listener:accept:302 (<0.6780.0>) Accepted connection 10.0.44.2:30579 -> 192.168.45.7:5222
2017-11-13 11:39:36.765 [error] <0.6781.0>@ejabberd_auth:get_password_with_authmodule:345 gen_server <0.6781.0> terminated with reason: no case clause matching {<<"true">>,ejabberd_auth_http} in ejabberd_auth:get_password_with_authmodule/2 line 345
cromain commented 6 years ago

ejabberd_auth_http is not updated to last ejabberd_auth API

cromain commented 6 years ago

see patch on https://github.com/processone/ejabberd-contrib/issues/228. maybe enough to fix that module. A clean PR would be best for integration.