Dear Cakers,
first of all I want to say it’s a pain in the ass migrating this thing with such a minimal documentation, it’s much more complicated than before.
I am using Basic Auth and the documentation about this is kept so minimal
I first realised, that the allowUnauthenticated method is not working… what a shame…
So my current problem is, that my project had a scope during auth, where I only filtered users, which have the field locked=0 - now I don’t know how to achieve this again, this was the old code:
// add http-basic-authentication with login-data stored in "Users"
$this->loadComponent('Auth', [
'authenticate' => [
'Ldap' => [
'realm' => utf8_decode(Configure::read('AdminSettings.AppName')),
'fields' => ['username' => 'name', 'password' => 'password'],
'userModel' => 'Users',
'scope' => array('Users.locked' => 0, 'Users.dpa_approved' => 1)
],
],
'checkAuthIn' => 'Controller.initialize',
'storage' => 'Memory',
'unauthorizedRedirect' => false,
'authorize' => [
'Controller' // isAuthorized method in Controllers
],
'authError' => __('Access denied.')
]);
(It’s called Ldap because I wrote a custom Auth where, depending on another field; the auth is done via Ldap or via SQL database. I think I will remove this Ldap feature completely, because there is currently no documentation as it was in cakePHP 3 to achieve all that.)