title: How to make freeradius authenticate with CHAP instead with PAP
body: <p>I i have installed freeradius 3 on server, and i have try to test chap by </p>
  
  <pre><code>radtest -t chap ahmed test localhost 1812 testing123 
  </code></pre>
  
  <p>and i received "Access-Accept".</p>
  
  <p>But when i tried to connect through captive portal with the same credential, it authenticate via PAP cause the password that saved in <strong>radpostauth</strong> table is saved as clear text, this mean that radius is authenticated via PAP.</p>
  
  <p>i also read that in file <strong>sites-enabled/default</strong> in the <em>Authentication</em> section </p>
  
  <blockquote>
    <p>This section lists which modules are available for authentication.
      Note that it does NOT mean 'try each module in order'.  It means
     that a module from the 'authorize' section adds a configuration
     attribute 'Auth-Type := FOO'.  That authentication type is then
     used to pick the appropriate module from the list below.</p>
  </blockquote>
  
  <p>and when i try to add </p>
  
  <pre><code>Auth-Type := CHAP
  </code></pre>
  
  <p>inside authenticate to be like this </p>
  
  <pre><code>authenticate 
  {
       Auth-Type := CHAP
  }
  </code></pre>
  
  <p>it gives me an error</p>
  
  <pre><code>/etc/raddb/sites-enabled/default[452]: Entry is not a reference to a module
  /etc/raddb/sites-enabled/default[444]: Errors parsing authenticate section.
  </code></pre>
  
  <p>So where i should tell radius to authenticate with CHAP only ??</p>