title: Symfony2 Security.yml
body: <p>I'm trying to take advantage of Symfony's authentication and authorization capabilities however I'm somewhat confused as to what my security.yml file should look like.</p>
  
  <p>I'm looking to accomplish the following objectives:</p>
  
  <p>1) The routes / and /join (are avilable to everyeone - no login required).</p>
  
  <p>2) all other routes require a login/password.</p>
  
  <p>3) the /adimin route should be futher restricted to admin users only.</p>
  
  <p>4) all users should be authenticated against the database. </p>
  
  <p>I have item 4 figured out (I think) - see below. I'm not sure what the <code>administrators:</code> word means though. Does that mean only administrators use the User class? Should that say <code>users:</code> or something else?</p>
  
  <pre><code>security:
      encoders:
          MySite\Bundle\Entity\User:
              algorithm: sha1
              encode_as_base64: false
              iterations: 1
  
  providers:
      administrators: (??? what doest his mean ???)
          entity: { class: MySiteBundle:User }
  </code></pre>
  
  <p>More Importantly -- </p>
  
  <p>For Items 1, 2, and 3 I'm not sure what to put. I have a bunch of entries under the <code>firewalls:</code> section and the <code>access_control:</code> sections however It just doesnt work or make sense. Can someone post what the security.yml should look like just by the goals I'm looking to accomplish in numbers 1 - 3?</p>