processone / ejabberd-contrib

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

ejabberd_auth_http stops making http call to check password on ejabberd 18.09 #265

Closed damirci closed 5 years ago

damirci commented 5 years ago

I have configured ejabberd_auth_http and it works fine but some times does not call check_password, and after restard the ejabberd starts working, here is the authentication log without any check password.

auth_method: http
auth_opts:
  host: "https://api2.test.com"
  connection_pool_size: 10
  connection_opts: []
  basic_auth: ""
  path_prefix: "/api/ChatAuth/"
auth_password_format: plain

2018-12-09 09:06:42.460 [warning] <0.633.0>@ejabberd_c2s:handle_auth_failure:447 (http_bind|<0.632.0>) Failed c2s PLAIN authentication for 8358f98d-b644-4bf7-a502-364cd2625fea@test.com from 77.111.247.48: Invalid username or password 2018-12-09 09:06:42.460 [debug] <0.632.0>@ejabberd_bosh:do_reply:679 send reply: RequestID: 921884230 Reply: {body,<<>>,[],[{xmlstreamelement,{xmlel,<<"failure">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],[{xmlel,<<"not-authorized">>,[],[]},{xmlel,<<"text">>,[{<<"xml:lang">>,<<"en">>}],[{xmlcdata,<<"Invalid username or password">>}]}]}}],0} To: {<0.631.0>,#Ref<0.876588528.3315335170.3568>} State: {state,<<"kalgram.com">>,<<"9046057fe28ff4c7c24e4f1b3230bc83690cb7b9">>,{{[],[]},0,unlimited},{{[],[]},0,unlimited},{state,1000,1000,1000,1544346402473792},<0.633.0>,<<"1.0">>,#Ref<0.876588528.3315335170.3574>,#Ref<0.876588528.3315335170.3570>,60,30,921884230,<<>>,undefined,unlimited,{1,{921884229,{body,<<>>,[{sid,<<"9046057fe28ff4c7c24e4f1b3230bc83690cb7b9">>},{wait,60},{ver,<<"1.11">>},{polling,2},{inactivity,30},{hold,1},{'xmpp:restartlogic',true},{requests,2},{secure,true},{maxpause,120},{'xmlns:xmpp',<<"urn:xmpp:xbosh">>},{'xmlns:stream',<<"http://etherx.jabber.org/streams">>},{from,<<"kalgram.com">>}],[{xmlstreamstart,<<"stream:stream">>,[{<<"id">>,<<"3588855836301866114">>},{<<"version">>,<<"1.0">>},{<<"xml:lang">>,<<"en">>},{<<"xmlns:stream">>,<<"http://etherx.jabber.org/streams">>},{<<"from">>,<<"kalgram.com">>},{<<"xmlns">>,<<"jabber:client">>}]},{xmlstreamelement,{xmlel,<<"stream:features">>,[],[{xmlel,<<"mechanisms">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],[{xmlel,<<"mechanism">>,[],[{xmlcdata,<<"PLAIN">>}]},{xmlel,<<"mechanism">>,[],[{xmlcdata,<<"X-OAUTH2">>}]}]}]}}],0},nil,nil}},{1,{921884230,{{<0.631.0>,#Ref<0.876588528.3315335170.3568>},{body,<<>>,[],[],0}},nil,nil}},{{[],[]},0,1000},{{77,111,247,48},32993},2}

damirci commented 5 years ago

this is solved by disabling auth cache