Closed SteijlenGLR closed 4 years ago
Those two files are created in the step where artisan vendor:publish
is run.
Although I ran through all steps multiple times, when I run the artisan command, the two files are Not created. It says Publish completed, but no files are created.
[cid:image001.png@01D4EE05.B70AC310]
Hi @SteijlenGLR, run the two following commands:
php artisan vendor:publish --provider "Adldap\Laravel\AdldapServiceProvider"
php artisan vendor:publish --provider "Adldap\Laravel\AdldapAuthServiceProvider"
These will create the ldap.php
and ldap_auth.php
files inside your config
directory.
That helped! Thanks @stevebauman ! Although I followed the tutorial at https://adldap2.github.io/Adldap2-Laravel/#/ In the tutorial it clearly states in multiple places to run a different command.
php artisan vendor:publish --provider="Adldap\Laravel\AdldapServiceProvider" php artisan vendor:publish --provider="Adldap\Laravel\AdldapAuthServiceProvider"
Is there any source information or boilerplate that has a working copy of a working LoginControler?
No problem @SteijlenGLR!
In the tutorial it clearly states in multiple places to run a different command.
They are the same commands. The =
is the only difference with the commands I posted above, but both will work identically.
Is there any source information or boilerplate that has a working copy of a working LoginControler?
You don't need to modify your LoginController
(unless you're using usernames instead of emails).
After you enable and configure Adldap2-Laravel's auth driver, you simply login with Laravel's pre-made LoginController
and views.
Those with the = sign did not work for me, it did give me the notification the command ran successfully but did not actually create the files.
I do need to use usernames instead of an email address. I found this tutorial https://github.com/jotaelesalinas/laravel-simple-ldap-auth It uses a different version and the steps do not seem to be identical, are there any more up to date versions or examples on how to login given the username instead of the email address?
Those with the = sign did not work for me, it did give me the notification the command ran successfully but did not actually create the files.
Hmmm... I can't reproduce that. What Laravel version are you using?
Snippet:
C:\adldap> php artisan vendor:publish --provider="Adldap\Laravel\AdldapServiceProvider"
Copied File [\Adldap2-Laravel\src\Config\config.php] To [\config\ldap.php]
Publishing complete.
C:\adldap> php artisan vendor:publish --provider="Adldap\Laravel\AdldapAuthServiceProvider"
Copied File [\Adldap2-Laravel\src\Config\auth.php] To [\config\ldap_auth.php]
Publishing complete.
I found this tutorial https://github.com/jotaelesalinas/laravel-simple-ldap-auth It uses a different version and the steps do not seem to be identical, are there any more up to date versions or examples on how to login given the username instead of the email address
This isn't my tutorial, so I can't help you with its steps. It contains some outdated information (such as the ldap
keys in the ldap_auth.php
file). I can however point you to the regular quick start guide:
https://adldap2.github.io/Adldap2-Laravel/#/auth/introduction?id=quick-start-from-scratch
Thanks @stevebauman,
If I run with these = sign I do get the message "Publishing complete" but without the message that it created a file.
I'll pick-up on your manual and will take it from there. I do have an issue now with my /login route not being picked-up so am not able to debug unfortunately. If I run it on the server it works, but I can't login, it keeps coming back with the login form, but I can't debug on the server to see what is going on :-(
No problem @SteijlenGLR. What Laravel version are you using?
If you're also using the latest Adldap2-Laravel, you can enable logging in both ldap.php
and your ldap_auth.php
file and then check your storage/logs
directory to see what is going on.
"php": "^7.1.3", "adldap2/adldap2-laravel": "v5.1.3", "laravel/framework": "5.8.*",
I initially started with version 3 --> Gave me many errors Switched to version 6 --> could not get it to work without extensive debugging and changes to the vendor files (Not really what I want). Then follow the manual and this seemed to be related to version 5 so chose that one.
Switched to version 6 --> could not get it to work without extensive debugging and changes to the vendor files (Not really what I want).
v6 is the latest, I would obviously suggest that for use since it has more flexibility, especially with logging.
I'm not sure what you would exactly need to change in your vendor
files, since v5.0 and v6.0 are actually very similar - v6.0 just containing more features and flexibility.
Hi @SteijlenGLR and @stevebauman! Thank you for your input.
Use Adldap2-Laravel and ignore this guide if you want -and you are allowed- to do your user management in the LDAP server via your Laravel application. That is, creating, modifying and deleting users as you would normally do with a MySQL database.
If, as it was my case, the user management is done in the LDAP server by another admin -that is not me- via a totally different management application and Laravel has read-only access and can only check if a given user/password combination exists or not, only then use this guide to configure Laravel. I suggest starting with a fresh installation.
Please, let me know if it can be done in an easier way with Adldap2-Laravel. I will be glad to simplify my setup!
Hi, unfortunately I do need a non-admin login to LDAP since I do not have the rights to update or create any users on the Active Directory server.
I’ll try to pick this up tomorrow morning since it’s getting late here. I first need to figure out why my local server is no longer routing my /login page. This worked and all of a sudden I get these 404 errors so I’m unable to debug.
I’ll also try to update to version 6.0 again so I can enable logging for LDAP specifically. Thanks both so far👍
I created a composer package out of this tutorial. You can give it a try.
Hi,
I'm struggling to get this to work. Tried it 4 times but whatever I do and what tutorial I follow I end-up disappointed with a non-working authentication. After several attempts, I decided to do a complete reinstall based on your step-by-step tutorial.
Instead of using the latest ADLdap2-laravel implementation, I choose version 5.1.3 as you mentioned that to work late 2018?!
But at some stage, you tell me to change the ldap.php and the ldap_auth.php files. However, those files are not created. They were a couple of attempts ago, but I have no clue why it worked then and not while following your instructions.
Do you have any clues about how to generate those files?