title: Moodle External Database Authentication With Salt Hashing
body: <p>I'm setting up Moodle 3.0 to allow users from my CMS (developed using the framework CakePHP 2.6) to login into Moodle. The two databases are on the same server. I'm using the option "External Database" from Moodle, it seems to be the easiest solution to set up.</p>
  
  <p>According to Moodle Docs the script <code>/path/to/moodle/auth/db/cli/sync_users.php</code> imports the users from the external database (CMS) to Moodle, this works perfectly, but the login into Moodle using the credentials (username and password) from the external database doesn't work.</p>
  
  <p>I think the problem might be the "Format password" (I'm using SHA-1 hash) in "External Database" setup. Because in CakePHP there's password hashing (SHA1 using salt). When I set "Format password" to "Plain text" it works, but that's not what I want. There's some way to solve this?</p>
  
  <p><a href="https://docs.moodle.org/27/en/External_database_authentication" rel="nofollow">https://docs.moodle.org/27/en/External_database_authentication</a></p>