Commit Graph

22 Commits

Author SHA1 Message Date
Jellyfrog
77c531527c Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00
louis-oui
ef562f607e LDAP Add option to authenticate user independtly of OU (#10873)
* Add option to authenticate user independtly of OU
* Set config option in webui
* Compatibility with bind username option
* ran ./lnms translation:generate
* update doc
2019-11-22 19:29:47 +01:00
louis-oui
ab2f909a9d Fix LDAP slow login and unable to login (#10872)
* Fix LDAP slow login
* Keep getUserList as is and implement fix in getUser function
* Split getUser function for CodeClimate
* Rewrite GetUser
* Fix no ldap auth when bind user configured - https://community.librenms.org/t/ldap-authentication-problem-with-webui/6115/2
2019-11-22 15:38:42 +01:00
louis-oui
f19bbcab41 Revert "Fix LDAP slow login (#10760)" (#10855)
This reverts commit baab9596a0.
2019-11-20 22:58:06 +00:00
louis-oui
baab9596a0 Fix LDAP slow login (#10760)
* Fix LDAP slow login
* Keep getUserList as is and implement fix in getUser function
* Split getUser function for CodeClimate
* Rewrite GetUser
2019-11-19 14:16:07 +01:00
ifred16
77d94a458b Allow filtering of getUserlist LDAP function (#10399)
* Modification of the getUserlist fonction to use ldap filter

* Modification of the getUserlist fonction to use ldap filter V2

* documentation of auth_ldap_Userlist_filter option

* documentation of auth_ldap_Userlist_filter option V2

* Allow filtering of getUserlist LDAP function
2019-07-23 22:57:16 -05:00
Tony Murray
0aded95985 Fix ldap/ad auth anon-bind (#9905) 2019-03-05 12:14:21 -06:00
Tony Murray
f4a33c1a34 Prevent credentials from being leaked in backtrace in some instances (#9817)
* Prevent credentials from being leak in backtrace in some instances
Particularly before the user is authenticated

* fix test
2019-03-05 00:24:14 -06:00
Tony Murray
b5714820de Improved Exception handling (#9844)
* Update LibreNMS exception output
Use built-in laravel exception rendering.
DuskUnsafeExcpetion is triggered before Blade(view) is booted, so, try to boot it

* Cleaner blade registration

* Change 500 error page to generic LibreNMS error page.

* Handle generic exceptions from laravel better.

* Custome LdapMissingException

* Cleanup, don't need to override convertExceptionToResponse anymore

* Update unauthenticated code to current upstream style

* UpgradableException interface

* LdapMissingException extend AuthenticationException

* Code climate cleanups

* Fix code style
2019-02-21 12:08:35 -06:00
Tony Murray
44747fda25 Bind user before fetching (#9312)
* Bind user before fetching

* fix style
2018-10-11 21:29:57 +02:00
Tony Murray
e8cf6bb385 Fix API auth issues (#9185)
* Fix API auth issues
Api access page now creates tokens with the correct ID.
Correctly creates users for legacy user tokens.
Fix Ldap comparison
Laravel Util class to make code easier to access/read

* More api access page fixes

* fix style
2018-09-11 22:36:52 -05:00
Tony Murray
32a7c50189 Use Laravel authentication (#8702)
* Use Laravel for authentication
Support legacy auth methods
Always create DB entry for users (segregate by auth method)

Port api auth to Laravel

restrict poller errors to devices the user has access to

Run checks on every page load.  But set a 5 minute (configurable) timer.
Only run some checks if the user is an admin

Move toastr down a few pixels so it isn't as annoying.

Fix menu not loaded on laravel pages when twofactor is enabled for the system, but disabled for the user.
Add two missing menu entries in the laravel menu

Rewrite 2FA code
Simplify some and verify code before applying

Get http-auth working
Handle legacy $_SESSION differently.  Allows Auth::once(), etc to work.

* Fix tests and mysqli extension check

* remove duplicate Toastr messages

* Fix new items

* Rename 266.sql to 267.sql
2018-09-11 07:51:35 -05:00
Tony Murray
01e8a6e089 Fix ldap fetching user_id as string (#9067) 2018-08-23 22:40:29 +01:00
TheGreatDoc
979f811ea9 Allow to use full DN as value for member attribute instead of member: username (#8969)
Allow to use full DN as value for member attribute instead of member: username

I dont use LDAP so this should be tested with both methods.

For using fulldn as user `$config['ldap_auth_userdn'] = true;` must be set in config.php

This comes from https://community.librenms.org/t/feature-request-full-dn-as-group-member-attibute-in-ldap-auth/4805

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [ x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-08-05 13:52:54 +01:00
Tony Murray
1a26017338 bug: LDAP fall back to slow search if memberof is missing (#8491) 2018-03-29 20:50:55 +01:00
Tony Murray
5c83aa1e28 refactor: LDAP debug output (#8434)
* LDAP debug
Updated LDAP and AD docs
ldap protocol default to v3 (so we don't have to set it all the time).  If this fails it should revert to v2.
ad was using auth_ad_timeout incorrectly (1 I think)

* Add option to list all users.
2018-03-29 11:40:27 +01:00
James Long
aefc224a0a feature: Improve LDAP filters for getUserlist and getUserlevel (#8398) 2018-03-20 13:20:11 +00:00
pep-un
0e09e09f04 bug: Improve LDAP filter in the getUserlist() function (#8253)
Improve LDAP filtering to improve the speed of some pages (Dashboard and
Edit User mainly). If we don't apply this filter all the users are getted
from LDAP and used in to the loop, with 2k users (for us) the page take
more than 15 seconds to be loaded.

I have check than people still have differante access with this fix.
2018-03-09 17:58:28 +01:00
Ultra2D
adca942552 Fix: Add user level to getUser for LDAP authentication (#7896)
* Fix: Add user level to getUser for LDAP authentication

* Fix: Add user level to getUser for LDAP authentication for current user only
2017-12-12 07:46:29 -06:00
Tony Murray
6b5dccc169 refactor: AD Auth defer connection until it is needed (#7768)
* refactor: AD Auth defer connection until it is needed
Nice error if php-ldap is missing instead of http 500.

* Add the same error when ldap is missing to other auth methods.
Not as graceful looking in the authorizers since they do not defer connection.
2017-11-28 09:19:34 -06:00
Tony Murray
d8c33463c6 fix: ldap auth typo (#7766) 2017-11-19 13:02:19 -06:00
mcq8
c9728a1f71 refactor: Refactored authorizers to classes (#7497)
* Refactored authorizers to classes

* Merge changes for #7335

* ! fix php 5.3 incompatibility

* Update ADAuthorizationAuthorizer.php

* Fix get_user -> getUser

* Rename AuthorizerFactory to Auth, fix interface missing functions

* Add phpdocs to all interface methods and normalize the names a bit.

* Re-work auth_test.php AD bind tests to work properly with the new class.
Reflection is not the nicest tool, but I think it is appropriate here.
Handle exceptions more nicely in auth_test.php

* Restore AD getUseList fix

Not sure how it got removed

* fix auth_test.php style
2017-11-18 10:33:03 +00:00