Authentication failed when LDAP server is off #620
-
Hi, Are there any steps I might have missed? or am I missunderstanding about this sync_passwords?
Or maybe I misunderstood that I thought the system would automatically switch when the ldap server is unreachable, hence I should switch the auth guard driver manually (?) Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @billydekid, You need to enable Fallback Authentication, which is basically just providing a $credentials = [
'mail' => $this->email,
'password' => $this->password,
'fallback' => [
'email' => $this->email,
'password' => $this->password,
],
];
if (Auth::attempt($credentials)) {
// ...
} I don't use Filament, so I can't instruct you how to insert this or modify its authentication behaviour. |
Beta Was this translation helpful? Give feedback.
-
Hi, <?php
namespace App\Filament\Auth;
use Filament\Pages\Auth\Login as BaseAuth;
class Login extends BaseAuth
{
/**
* bw ~ override
* Override to set the mail key which is passed to the LdapRecord authentication provider
*/
protected function getCredentialsFromFormData(array $data): array
{
return [
'mail' => $data['email'],
'password' => $data['password'],
'fallback' => [
'email' => $data['email'],
'password' => $data['password'],
],
];
}
} Many thanks! |
Beta Was this translation helpful? Give feedback.
Hi @billydekid,
You need to enable Fallback Authentication, which is basically just providing a
fallback
array key in the credentials array that is sent throughAuth::attempt()
:I don't use Filament, so I can't instruct you how to insert this or modify its authentication behaviour.