Changeset 2314

Show
Ignore:
Timestamp:
11/03/08 19:55:54 (2 months ago)
Author:
taher
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/doc/cookbook_authentication.txt

    r1836 r2314  
    1717* link:modules_validators_pam.html[PAM] 
    1818* link:modules_validators_plain.html[Plain] 
     19* link:modules_validators_authlist.html[Fixed List] 
    1920 
    2021You will also find interesting information in the 
     
    158159 
    159160 
     161Another usage example 
     162~~~~~~~~~~~~~~~~~~~~~ 
     163 
     164As you can see, getting the hang of how authentication works is pretty 
     165easy. Let's ilustrate another easy example. How to serve PHP files, 
     166both from a protected location and an unprotected one? 
     167 
     168Let's assume our locations are targets are: 
     169- /unprotected/*.php 
     170- /protected/*.php 
     171 
     172Well... this would be really easy. You just have to remember that 
     173rules are evaluated from top to bottom, and the evaluation proceeds 
     174until a final rule is matched. 
     175 
     176This means that we would only have to be careful with the order of our 
     177rules, and it would be as simple as setting a couple of rules: 
     178 
     179- The first one, of type `Directory` applied to the path 
     180  `/protected`. This would be the top rule, should use one of the 
     181  authentication mechanisms mentioned above and should not be set as 
     182  _FINAL_. 
     183 
     184- The second one, of type `Extension` would apply to `php` files and 
     185  should be configured as according to the link:cookbook_php.html[PHP 
     186  recipe]. This one should be a _FINAL_ rule. 
     187 
     188And this would be more than enough. The files from the secure location 
     189would match the first rule and the authentication would be 
     190required. In case it was successful, not being a final rule, the 
     191request would proceed to the second rule. Once there, the regular 
     192processing of PHP files would take palce. This one is a _FINAL_ rule, 
     193so the rule evaluation would stop. 
     194 
     195In case the PHP files were not being requested from the secured 
     196directory, just the second rule would apply. 
     197 
    160198//// 
    161199To be written