External scripts
In this authentication module, when Ejabberd is started, it launches a script to invoke its authentication task.
The service administrator can use any of the language to write external scripts, and the interface details between Ejabberd and scripts are described in the Ejabberd Development Guide. There are also instances of authentication scripts here. Links: Https://www.ejabberd.im/extauth
Here are some special options:
Extauth_program:pathtoscript
This option represents the full path of the external script. The script must be ejabberd capable of executing.
Extauth_instances:integer
Represents the number of script instances that run authentication requests concurrently in the virtual host, with a minimum of 1 default values.
extauth_cache:false| CacheTime Integer
The default value is false to disable caching, the value is 0 to turn on the statistical cache, but not to use its cached information to authenticate users, if set other values, then turn on statistics and authentication two: Cachetimeinteger represents the number of seconds Ejabberd can reuse authentication information, Because the user has disconnected, to re-authenticate the user, do not have to re-query the external authentication script.
Note: In a host if the internal authentication is initiated the cache should not be enabled. If the cache is enabled, Mod_last must also be enabled in its vhost.
Instance
This external authentication is set up, external script, open cache for 10 minutes, and 3 script instances are declared for each virtual host in Ejabberd.
Auth_method: [External]
Extauth_program: "/etc/ejabberd/jabberauth.class.php"
extauth_cache:600
Extauth_instances:3
The configuration of external authentication is done after the official instance configuration, and all we need to do is write the external script.
"Translation" Ejabberd use of external scripts