I already have a schema of users with authentication-key and wanted to do authentication via that. I tried implementing authentication via sql but due to different structure of my schema I was getting error and so I implemented external-authentication method. The technologies and OS used in my application are :
- Node.JS
- Ejabberd as XMPP server
- MySQL Database
- React-Native (Front-End)
- OS - Ubuntu 18.04
I implemented the external authentication configuration as mentioned in https://docs.ejabberd.im/admin/configuration/#external-script and took php script https://www.ejabberd.im/files/efiles/check_mysql.php.txt as an example. But I am getting the below mentioned error in error.log. In ejabberd.yml I have done following configuration.
...
host_config:
"example.org.co":
auth_method: [external]
extauth_program: "/usr/local/etc/ejabberd/JabberAuth.class.php"
auth_use_cache: false...
Also, is there any external auth javascript script?
Here is the error.log and ejabberd.log as mentioned below
error.log
2019-03-19 07:19:16.814 [error] <0.524.0>@ejabberd_auth_external:failure:103 External authentication program failed when calling 'check_password' for admin@example.org.co: disconnected
ejabberd.log
2019-03-19 07:19:16.811 [debug] <0.524.0>@ejabberd_http:init:151 S: [{[<<"api">>],mod_http_api},{[<<"admin">>],ejabberd_web_admin}]
2019-03-19 07:19:16.811 [debug] <0.524.0>@ejabberd_http:process_header:307 (#Port<0.13811>) http query: 'POST' <<"/api/register">>
2019-03-19 07:19:16.811 [debug] <0.524.0>@ejabberd_http:process:394 [<<"api">>,<<"register">>] matches [<<"api">>]
2019-03-19 07:19:16.811 [info] <0.364.0>@ejabberd_listener:accept:238 (<0.524.0>) Accepted connection ::ffff:ip -> ::ffff:ip
2019-03-19 07:19:16.814 [info] <0.524.0>@mod_http_api:log:548 API call register [{<<"user">>,<<"test">>},{<<"host">>,<<"example.org.co">>},{<<"password">>,<<"test">>}] from ::ffff:ip
2019-03-19 07:19:16.814 [error] <0.524.0>@ejabberd_auth_external:failure:103 External authentication program failed when calling 'check_password' for admin@example.org.co: disconnected
2019-03-19 07:19:16.814 [debug] <0.524.0>@mod_http_api:extract_auth:171 Invalid auth data: {error,invalid_auth}
Any help regarding this topic will be appreciated.