-
-
Notifications
You must be signed in to change notification settings - Fork 43
[LdapRecord-Laravel] Authentication occurs twice using Laravel Fortify #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Babiute, How are you authenticating with Fortify::authenticateUsing('...'); |
Hi @stevebauman .
|
Ok, can you share your login view so I can understand how you're sending the post request? |
Also, do you have two-factor authentication enabled inside of your |
About the routes, I do not have my own login/logout routes. Im using the Login and Logout routes provided by Fortify default installation.
|
No. Every default feature is disabled. |
Yup absolutely -- I did not ask for the routes. Can you post your |
About the routes, I was just trying to antecipate a possible question 👍 As I'm using multi-domain authentication, Im not using the default model. Im using the 'alpha' user.
|
No worries! Aren't you using database synchronization? That's what the logs indicate. I'm looking for your applications Your // config/auth.php
'providers' => [
// ...
'ldap' => [
'driver' => 'ldap',
'model' => LdapRecord\Models\ActiveDirectory\User::class,
'database' => [
'model' => App\Models\User::class, // <-- This model here.
'...',
],
],
], |
Yes I got it.
Either way follows the model, but it doesn't even exist in the plain authentication branch where the double authentication is happening too.
|
I think I've discovered the issue. In Laravel Fortify, by default, it will always attempt the protected function loginPipeline(LoginRequest $request)
{
if (Fortify::$authenticateThroughCallback) {
return (new Pipeline(app()))->send($request)->through(array_filter(
call_user_func(Fortify::$authenticateThroughCallback, $request)
));
}
if (is_array(config('fortify.pipelines.login'))) {
return (new Pipeline(app()))->send($request)->through(array_filter(
config('fortify.pipelines.login')
));
}
return (new Pipeline(app()))->send($request)->through(array_filter([
config('fortify.limiters.login') ? null : EnsureLoginIsNotThrottled::class,
RedirectIfTwoFactorAuthenticatable::class, // <-- `$authenticateUsingCallback` called here
AttemptToAuthenticate::class, // <-- `$authenticateUsingCallback` called here
PrepareAuthenticatedSession::class,
]));
} First, the The To work around this, you either have to define your own login pipeline inside of your |
Hey Steve. |
Hi @Babiute, last night I pushed a PR into Laravel Fortify that resolves this issue and it was merged this morning 🎉 : Once a new release of Laravel Fortify is created, it should contain this fix 👍 |
Using
LdapRecord - 1.7.3
Fortify with custom UI 1.6
Laravel 8
Hello.
I don't know if this would be the normal procedure, but it seems to me, from the log bellow, that the authentication routine is running twice. It would be normal or there is probably something wrong with my application, because if that's the case, I've tried to investigate here and I couldn't find where the problem could be. Any tips?
The text was updated successfully, but these errors were encountered: