changeset 307:fa73a9b9d907

mod_auth_external: Document protocol.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Oct 2012 01:23:33 +0500
parents 2ec60540a8c7
children f5d82d6588d4
files mod_auth_external.wiki
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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