# HG changeset patch # User Waqas Hussain # Date 1349814213 -18000 # Node ID fa73a9b9d907bc7200772672f08907bc1fc6610a # Parent 2ec60540a8c7c76919c94a8f351965840b0749e9 mod_auth_external: Document protocol. diff -r 2ec60540a8c7 -r fa73a9b9d907 mod_auth_external.wiki --- a/mod_auth_external.wiki Wed Sep 26 00:50:02 2012 +0000 +++ b/mod_auth_external.wiki Wed Oct 10 01:23:33 2012 +0500 @@ -18,5 +18,40 @@ ||external_auth_protocol||May be "generic" or "ejabberd" (the latter for compatibility with ejabberd external auth scripts. Default is "generic".|| ||external_auth_command||The command/script to execute.|| += Protocol = + +Prosody executes the given command/script, and sends it queries. + +Your auth script should simply read a line from standard input, and write the result to standard output. + +Each command is one line, and the response is expected to be a single line containing "0" for failure or "1" for success. + +There are three commands used at the moment: + +== auth == +Check if a user's password is valid. + +Example: {{{auth:username:example.com:abc123}}} + +== isuser == +Check if a user exists. + +Example: {{{isuser:username:example.com}}} + +== setpass == +Set a new password for the user. Implementing this is optional. + +Example: {{{setpass:username:example.com:abc123}}} + +Your script must respond with "0" for anything it can't handle. + +== ejabberd compatibilty == +ejabberd implements a similar protocol. The main difference is that Prosody's protocol is line-based, while ejabberd's is length-prefixed. + +Add this to your config if you need to use an ejabberd auth script: +{{{ + external_auth_protocol = "ejabberd" +}}} + = Compatibility = ||0.8||Works|| \ No newline at end of file