comparison mod_auth_external.wiki @ 307:fa73a9b9d907

mod_auth_external: Document protocol.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Oct 2012 01:23:33 +0500
parents 1941dc75dca9
children f5d82d6588d4
comparison
equal deleted inserted replaced
306:2ec60540a8c7 307:fa73a9b9d907
16 These options are specific to mod_auth_external: 16 These options are specific to mod_auth_external:
17 17
18 ||external_auth_protocol||May be "generic" or "ejabberd" (the latter for compatibility with ejabberd external auth scripts. Default is "generic".|| 18 ||external_auth_protocol||May be "generic" or "ejabberd" (the latter for compatibility with ejabberd external auth scripts. Default is "generic".||
19 ||external_auth_command||The command/script to execute.|| 19 ||external_auth_command||The command/script to execute.||
20 20
21 = Protocol =
22
23 Prosody executes the given command/script, and sends it queries.
24
25 Your auth script should simply read a line from standard input, and write the result to standard output.
26
27 Each command is one line, and the response is expected to be a single line containing "0" for failure or "1" for success.
28
29 There are three commands used at the moment:
30
31 == auth ==
32 Check if a user's password is valid.
33
34 Example: {{{auth:username:example.com:abc123}}}
35
36 == isuser ==
37 Check if a user exists.
38
39 Example: {{{isuser:username:example.com}}}
40
41 == setpass ==
42 Set a new password for the user. Implementing this is optional.
43
44 Example: {{{setpass:username:example.com:abc123}}}
45
46 Your script must respond with "0" for anything it can't handle.
47
48 == 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
51 Add this to your config if you need to use an ejabberd auth script:
52 {{{
53 external_auth_protocol = "ejabberd"
54 }}}
55
21 = Compatibility = 56 = Compatibility =
22 ||0.8||Works|| 57 ||0.8||Works||