comparison mod_auth_external.wiki @ 308:f5d82d6588d4

mod_auth_external: Clarify the protocol a bit more.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Oct 2012 01:28:20 +0500
parents fa73a9b9d907
children 35702f67785f
comparison
equal deleted inserted replaced
307:fa73a9b9d907 308:f5d82d6588d4
21 = Protocol = 21 = Protocol =
22 22
23 Prosody executes the given command/script, and sends it queries. 23 Prosody executes the given command/script, and sends it queries.
24 24
25 Your auth script should simply read a line from standard input, and write the result to standard output. 25 Your auth script should simply read a line from standard input, and write the result to standard output.
26 It must do this in a loop, until there's nothing left to read. Prosody can keep sending more lines to the script,
27 with a command on each line.
26 28
27 Each command is one line, and the response is expected to be a single line containing "0" for failure or "1" for success. 29 Each command is one line, and the response is expected to be a single line containing "0" for failure or "1" for success.
30 Your script must respond with "0" for anything it doesn't understand.
28 31
29 There are three commands used at the moment: 32 There are three commands used at the moment:
30 33
31 == auth == 34 == auth ==
32 Check if a user's password is valid. 35 Check if a user's password is valid.
41 == setpass == 44 == setpass ==
42 Set a new password for the user. Implementing this is optional. 45 Set a new password for the user. Implementing this is optional.
43 46
44 Example: {{{setpass:username:example.com:abc123}}} 47 Example: {{{setpass:username:example.com:abc123}}}
45 48
46 Your script must respond with "0" for anything it can't handle.
47
48 == ejabberd compatibilty == 49 == ejabberd compatibilty ==
49 ejabberd implements a similar protocol. The main difference is that Prosody's protocol is line-based, while ejabberd's is length-prefixed. 50 ejabberd implements a similar protocol. The main difference is that Prosody's protocol is line-based, while ejabberd's is length-prefixed.
50 51
51 Add this to your config if you need to use an ejabberd auth script: 52 Add this to your config if you need to use an ejabberd auth script:
52 {{{ 53 {{{