mod_auth_ha1/README.wiki
changeset 1786 29f3d6b7ad16
equal deleted inserted replaced
1785:12ac88940fe3 1786:29f3d6b7ad16
       
     1 #summary Authentication module for 'HA1' hashed credentials in a text file, as used by reTurnServer
       
     2 #labels Stage-Beta,Type-Auth
       
     3 
       
     4 = Introduction =
       
     5 
       
     6 This module authenticates users against hashed credentials stored in a plain text file. The format is the same as that used by reTurnServer.
       
     7 
       
     8 = Configuration =
       
     9 
       
    10 || *Name* || *Default* || *Description* ||
       
    11 || auth_ha1_file || auth.txt || Path to the authentication file||
       
    12 
       
    13 Prosody reads the auth file at startup and on reload (e.g. SIGHUP).
       
    14 
       
    15 = File Format =
       
    16 
       
    17 The file format is text, with one user per line. Each line is broken into four fields separated by colons (':'):
       
    18 
       
    19 {{{
       
    20 username:ha1:host:status
       
    21 }}}
       
    22 
       
    23 || *Field* || *Description* ||
       
    24 ||username||The user's login name||
       
    25 ||ha1||An MD5 hash of "username:host:password"||
       
    26 ||host||The XMPP hostname||
       
    27 ||status||The status of the account. Prosody expects this to be just the text "authorized"||
       
    28 
       
    29 More info can be found [https://github.com/resiprocate/resiprocate/blob/master/reTurn/users.txt here].
       
    30 
       
    31 == Example ==
       
    32 
       
    33 {{{
       
    34 john:2a236a1a68765361c64da3b502d4e71c:example.com:authorized
       
    35 mary:4ed7cf9cbe81e02dbfb814de6f84edf1:example.com:authorized
       
    36 charlie:83002e42eb4515ec0070489339f2114c:example.org:authorized
       
    37 }}}
       
    38 
       
    39 Constructing the hashes can be done manually using any MD5 utility, such as md5sum. For example the user 'john' has the password 'hunter2', and his hash can be calculated like this:
       
    40 
       
    41 {{{
       
    42 echo -n "john:example.com:hunter2" | md5sum -
       
    43 }}}
       
    44 
       
    45 = Compatibility =
       
    46 ||0.9||Works||
       
    47 ||0.10||Works||