Changes between Version 21 and Version 22 of CookBook/AccountManagerPluginConfiguration


Ignore:
Timestamp:
Jul 22, 2015, 8:47:10 AM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/AccountManagerPluginConfiguration

    v21 v22  
    1 [[PageOutline(2-5,content)]]
    2 
    3 = Cookbook: AccountManagerPlugin configuration =
    4 commented sample configurations for most common and some special use cases
    5 
    6 We collect some useful configuration examples here giving hints on proper use of available options.
    7 
    8  '''General hints:'''
     1[[PageOutline(2-5,Contents,pullout)]]
     2
     3= Cookbook: AccountManagerPlugin configuration
     4
     5This page lists some useful configuration examples with hints on proper use of available options.
     6
     7'''General hints:'''
    98 * Content for different section grouped in one example must be used together.
    109 * Option names are written in !CamelCase style notation, but will get (re-)written all-lowercase, if added/updated via the Trac admin web-UI. As you see, case doesn't really matter here.
    1110
    12 == Basic configuration/Kickstart ==
     11== Basic configuration/Kickstart
     12
    1313!AccountManagerPlugin replaces the traditional Trac login feature with a webform, because [wiki:AccountManagerPlugin/Modules#LoginModule LoginModule] is enabled in all examples below. No additional action is required since acct_mgr-0.4, but older plugin versions required to disable the obsoleted Trac core component explicitly:
    14 {{{
    15 #!cfg
     14{{{#!cfg
    1615[components]
    1716trac.web.auth.loginmodule = disabled
    1817}}}
    1918
    20 === !HtPasswdStore ===
    21 {{{
    22 #!cfg
     19=== !HtPasswdStore
     20
     21{{{#!cfg
    2322[account-manager]
    2423password_store = HtPasswdStore
     
    2827reset_password = false
    2928}}}
    30 {{{
    31 #!cfg
     29{{{#!cfg
    3230[components]
    3331acct_mgr.admin.* = enabled
     
    5048 * use `md5` password hash type for changed/new passwords, hint: use the cryptographically strongest, that is available on your system (and still compatible with other applications in shared-use case)
    5149
    52 ''Note:''  new configuration option 'htpasswd_file' for acct_mgr-0.4 and later
    53  see [wiki:AccountManagerPlugin/AuthStores#HtPasswdStore HtPasswdStore] module documentation for more details
    54 
    55 === !HtDigestStore ===
    56 {{{
    57 #!cfg
     50'''Note:''' new configuration option 'htpasswd_file' for acct_mgr-0.4 and later, see [wiki:AccountManagerPlugin/AuthStores#HtPasswdStore HtPasswdStore] module documentation for more details.
     51
     52=== !HtDigestStore
     53
     54{{{#!cfg
    5855[account-manager]
    5956password_store = HtDigestStore
     
    6360reset_password = false
    6461}}}
    65 {{{
    66 #!cfg
     62{{{#!cfg
    6763[components]
    6864acct_mgr.admin.* = enabled
     
    8581 * set realm to select relevant htdigest file entries to '`Trac`'
    8682
    87 ''Note:''  new configuration option 'htdigest_file' for acct_mgr-0.4 and later
    88  see [wiki:AccountManagerPlugin/AuthStores#HtDigestStore HtDigestStore] module documentation for more details
    89 
    90 === !SessionStore ===
    91 {{{
    92 #!cfg
     83'''Note:''' new configuration option 'htdigest_file' for acct_mgr-0.4 and later, see [wiki:AccountManagerPlugin/AuthStores#HtDigestStore HtDigestStore] module documentation for more details.
     84
     85=== !SessionStore
     86
     87{{{#!cfg
    9388[account-manager]
    9489hash_method = HtDigestHashMethod
     
    9792reset_password = false
    9893}}}
    99 {{{
    100 #!cfg
     94{{{#!cfg
    10195[components]
    10296acct_mgr.admin.* = enabled
     
    120114 * set realm to select relevant htdigest entries to '`TracDB`'
    121115
    122 ''Note:''  new configuration option 'db_htdigest_realm' for acct_mgr-0.4 and later
    123  see [wiki:AccountManagerPlugin/AuthStores#SessionStore SessionStore] module documentation for more details
    124 
    125 === Create users ===
     116'''Note:''' new configuration option 'db_htdigest_realm' for acct_mgr-0.4 and later, see [wiki:AccountManagerPlugin/AuthStores#SessionStore SessionStore] module documentation for more details.
     117
     118=== Create users
     119
    126120Create the first user through browser-based registration enabled by following additional lines in `components` section of `trac.ini`:
    127 {{{
    128 #!cfg
     121{{{#!cfg
    129122[components]
    130123acct_mgr.register.* = enabled
     
    132125
    133126Don't add another `components` section, just the configuration line with 'enabled' into an existing `components` section. After user creation you may choose to disable registration by uncommenting the [AccountManagerPlugin#RegistrationModule RegistrationModule] setting above or changing it to:
    134 {{{
    135 #!cfg
     127{{{#!cfg
    136128[components]
    137129;need this for first user
    138130acct_mgr.register.* = disabled
    139131}}}
    140 Or just use the plugins admin page form Trac's web interface, after you've given admin priviledges to the first user you created.
    141 
    142 === Award an existing user account for Trac admin ===
    143 {{{
    144 #!sh
     132Or just use the plugins admin page form Trac's web interface, after you've given admin privileges to the first user you created.
     133
     134=== Award an existing user account for Trac admin
     135
     136{{{#!sh
    145137trac-admin /path/to/env permission add <username> TRAC_ADMIN permission list <username>
    146138}}}
    147139
    148 === Goodies ===
    149 There are some misc options for `account-manager` section of `trac.ini` you may want to set/unset depending on your requirements:
     140=== Goodies
     141
     142There are some miscellaneous options for `account-manager` section of `trac.ini` you may want to set/unset depending on your requirements:
    150143||'''Option'''||'''Default Value'''||'''Recommendation'''||'''Available Since'''||
    151144||reset_password || True ||Disallow password reset if needed. ||acct_mgr-0.? ||
    152145||generated_password_length ||8 ||Useful only with reset enabled. Raise the bar for brute-force attacks on user passwords, if you feel this is needed. [AccountManagerPlugin#AccountGuard AccountGuard] might still be a more powerful alternative, see [#AccountLocking Account Locking] section below. ||acct_mgr-0.? ||
    153 ||force_passwd_change ||True ||Useful only with reset enabled. Randomly generated passwords should be motivation enough to change them, but YMMV.||acct_mgr-0.? ||
     146||force_passwd_change ||True ||Useful only with reset enabled. Randomly generated passwords should be motivation enough to change them, but this depends on local policy.||acct_mgr-0.? ||
    154147
    155148See the paragraphs below for a more detailed explanation of some of these settings.
    156149
    157 == Advanced configurations ==
    158 === Password Reset ===
     150== Advanced configurations
     151
     152=== Password Reset
     153
    159154You need an authentication store enabled and configured correctly as a pre-requisite here. Additionally explicitly enable or unset the following option:
    160 {{{
    161 #!cfg
     155{{{#!cfg
    162156[account-manager]
    163157;reset_password = false
    164158}}}
    165 {{{
    166 #!cfg
     159{{{#!cfg
    167160[components]
    168161acct_mgr.notification.accountchangelistener = enabled
     
    174167A detailed explanation of the [wiki:AccountManagerPlugin/Modules#Lostpasswordprocedure 'lost password' procedure] is available too.
    175168
    176 ''Note:'' Hiding of non-functional parts from the web-UI has been corrected for acct_mgr-0.4.1, and the plugin complains on misconfiguration too, see trac.log
    177 
    178 === Persistent Sessions ===
    179 {{{
    180 #!cfg
     169'''Note:''' Hiding of non-functional parts from the web-UI has been corrected for acct_mgr-0.4.1, and the plugin complains on misconfiguration too, see trac.log.
     170
     171=== Persistent Sessions
     172
     173{{{#!cfg
    181174[account-manager]
    182175persistent_sessions = true
    183176}}}
    184 will allow users to be remembered across sessions without needing to re-authenticate. This is, a user checks a "Remember Me" checkbox on the [wiki:AccountManagerPlugin/Modules#LoginModule login page] and, next time he visits the site, he/she will be remembered.
    185 
    186 === Single Sign On ===
     177will allow users to be remembered across sessions without needing to re-authenticate. That is, a user checks a "Remember Me" checkbox on the [wiki:AccountManagerPlugin/Modules#LoginModule login page] and, next time the user visits the site, he/she will be remembered.
     178
     179=== Single Sign On
     180
    187181In a setup with multiple Trac environments per domain/host chances are that users want to work with several projects simultaneously. 40 and more environments served by a single Trac install have been reported from private networks as well as seen on the web.
    188182
     
    190184
    191185In order to achieve this, set `auth_cookie_path` in the `[trac]` section of your `trac.ini` file to the '''URL''' path of your installations `TRAC_PARENT_DIR`. Assumed your projects use the URL `http://www.example.com/trac/<project_name>`, this should look like:
    192 {{{
    193 #!cfg
     186{{{#!cfg
    194187[trac]
    195188auth_cookie_path = /trac
    196189}}}
     190
    197191If you made this change to an existing setup, and encounter login problems afterwards, check the cookies stored in your browser. If it holds any `trac_auth` cookies with a path other than the one defined by `auth_cookie_path`, you might have to remove those as they might conflict.
    198192
    199193Hint: Even if this setting has been introduced in Trac 0.12, it could be set in `trac.ini` for older Trac versions, and !AcctMgr will use it, specifically providing a cookie path fix-up for `trac_auth` cookies generated by Trac 0.11 and above.
    200194
    201 An inherited trac.ini file is perfect for sharing this common setting and more between several Trac environments. Additionally delete existing `trac_auth` browser cookies. This is a one-time cleanup and only necessary to avoid unexpected login results after a cookie path change. Of course logging out in one Trac environment will terminate the authenticated session for all participants sharing authentication as indicated by the equal cookie path setting. A mixed setup containing both, authentication sharing and non-sharing environments side-by-side is valid and works well.
    202 
    203 === Account Locking ===
     195An inherited `trac.ini` file is perfect for sharing this common setting and more between several Trac environments. Additionally delete existing `trac_auth` browser cookies. This is a one-time cleanup and only necessary to avoid unexpected login results after a cookie path changes. Of course logging out in one Trac environment will terminate the authenticated session for all participants sharing authentication as indicated by the equal cookie path setting. A mixed setup containing both authentication sharing and non-sharing environments side-by-side is valid and works well.
     196
     197=== Account Locking
     198
    204199 * new feature since acct_mgr-0.3
    205200 * available options (displayed with default values here):
    206201
    207 {{{
    208 #!cfg
     202{{{#!cfg
    209203[account-manager]
    210204login_attempt_max_count = 0
     
    213207user_lock_time_progression = 1
    214208}}}
    215 {{{
    216 #!cfg
     209{{{#!cfg
    217210[components]
    218211acct_mgr.guard.accountguard = enabled
    219212}}}
    220 but this does '''nothing''' for backwards-compatibility, preventing surprises for unaware plugin-upgraders
    221 
    222 As long as login_attempt_max_count == 0, login failure tracking is actually disabled and no other related option matters. The account locking section in the configuration admin panel (since acct_mgr-0.4.1) is quite self-explaining in the way how it conditionally hides irrelevant options. So it's worth a look even for the console guru, who doesn't immediately understand these options.
    223 
    224 ==== Hard Lock-up ====
    225 {{{
    226 #!cfg
     213but this does '''nothing''' for backwards-compatibility, preventing surprises for unaware plugin-upgraders.
     214
     215As long as login_attempt_max_count == 0, login failure tracking is actually disabled and no other related option matters. The account locking section in the configuration admin panel (since acct_mgr-0.4.1) is quite self-explanatory in the way it conditionally hides irrelevant options. So it's worth a look even for the console guru, who doesn't immediately understand these options.
     216
     217==== Hard Lock-up
     218
     219{{{#!cfg
    227220[account-manager]
    228221login_attempt_max_count = 5
     
    233226 * no lock expiration, so release strictly '''requires administrator interaction'''
    234227
    235 ==== Fixed login retry delay ====
    236 fixed delay time regardless of number of successive failed login attempts
    237 
    238 {{{
    239 #!cfg
     228==== Fixed login retry delay
     229
     230Fixed delay time regardless of number of successive failed login attempts
     231
     232{{{#!cfg
    240233[account-manager]
    241234login_attempt_max_count = 3
     
    246239 * release account lock 30 seconds after last failed login attempt
    247240
    248 ==== Modestly progressing login retry delay ====
    249 {{{
    250 #!cfg
     241==== Modestly progressing login retry delay
     242
     243{{{#!cfg
    251244[account-manager]
    252245login_attempt_max_count = 2
     
    279272^![1]^ time after previous failed login attempt
    280273
    281 ==== Aggressively progressing, but limited login retry delay ====
    282 {{{
    283 #!cfg
     274==== Aggressively progressing, but limited login retry delay
     275
     276{{{#!cfg
    284277[account-manager]
    285278login_attempt_max_count = 4