Laravel 8: LDAP Login Succeeds, but redirected to login page #279
Unanswered
t0mcat1337
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Unfortunately I have the same behavior. :( |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
for hours I'm trying to implement LDAP Auth in a fresh setup Laravel 8 UI App without success.
I configured everything as described here:
https://ldaprecord.com/docs/laravel/v2/auth/plain/laravel-ui
After entering valid credentials in the LoginForm one can read this in the laravel.log:
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Binding - Username:
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Bound - Username:
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Search - Base DN: - Filter: (&(objectclass=top)(objectclass=person)(objectclass=organizationalperson)(objectclass=inetorgperson)(cn=userID)) - Selected: (objectguid,*) - Time Elapsed: 149.85
[2021-05-11 16:10:57] local.INFO: User [userID] has been successfully discovered for authentication.
[2021-05-11 16:10:57] local.INFO: User [userID] is authenticating.
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Attempting - Username: cn=userID,baseDN
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Binding - Username: cn=userID,baseDN
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Bound - Username: cn=userID,baseDN
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Passed - Username: cn=userID,baseDN
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Binding - Username:
[2021-05-11 16:10:57] local.INFO: LDAP (ldap://ldapURL:389) - Operation: Bound - Username:
[2021-05-11 16:10:57] local.INFO: User [userID] has successfully passed LDAP authentication.
[2021-05-11 16:10:57] local.INFO: User [userID] has successfully authenticated.
But then the LoginPage re-appears as if there was an error but no error message is shown. Obviously the HomeController redirects to it because the auth-middleware doesn't recognize the successful auth.
This is the code:
config/auth.php:
LoginController:
HomeController.php:
When commenting out "$this->middleware('auth');" in the HomeController::__construct() method, of course the Home - View appears, but dumping Auth::user() returns "null"...
Any hint what I'm doing wrong here?
Beta Was this translation helpful? Give feedback.
All reactions