Commit Graph

40 Commits

Author SHA1 Message Date
Tony Murray
503500f978 feature: AD now supports nested groups (resubmit #7175) (#7259)
* feature: AD support nested groups (resubmit #7175)
Don't let groups with periods in the name cause issues.

* Merge #7245 into this PR

* Capture Exceptions in get_userlevel()

* Throw generic error if auth_ad_debug is not enabled to prevent information leak.
2017-10-04 21:31:17 +01:00
Neil Lathwood
4683736fcf fix: Reverted previous active directory changes #7254 (#7257) 2017-08-29 19:53:05 +01:00
Frank Mogaddedi
0a5b20c452 feature: Active Directory user in nested groups (#7175)
* Active Directory user in nested groups

* Active Directory user in nested groups

* Active Directory user in nested groups

* Use Config in new function
2017-08-25 00:24:43 -05:00
Tony Murray
50b3ffb3cf feature: add timeout to AD auth, default is 5s (#6967)
* feature: add timeout to AD auth, default is 5s
Can be configured by $config['auth_ad_timeout']

* only set timeout during bind operation
2017-07-07 23:05:40 -05:00
Tony Murray
20b08cf595 refactor: finish logic and definition separation (#6883)
Clean up rewrites to only have function definitions
Move authentication initialization into a function
2017-07-03 15:38:58 -05:00
Tony Murray
683a10e723 fix: Improve authentication load time and security (#6615)
* fix: minimize session open time
page/graphs speedup part 2

Write close the session as soon as we no longer need to write to it. Prevents the session from blocking other requests.
Do not run through full authentication functions if the session is already authenticated.
Removes password from the session as well as some items to prevent session fixation from #4608.

WARNING: This will cause issues for ad/ldap users who do not have a bind user configured!

* Do no erase username when using cookie auth.
Properly close the session in ajax_setresolution.php

* write close the session as soon as possible in ajax_setresolution.php

* Remove session regeneration. It is not compatible with the current code and would require more changes.

* Totally refactor authentication.  Extract code to functions for re-use and improved readability

* Use exceptions for authentication and error logging
Tested: mysql, ad_auth with and without bind user

* fix a couple scrutinizer issues

* fix reauthenticate in radius
2017-05-15 22:18:23 -05:00
Tony Murray
c5c643f901 fix: AD authentication when auth_ad_base_dn is an OU (#6405)
* fix: AD authentication when auth_ad_base_dn is an OU
OUs don't have SID, so we can't use them to figure out the domain SID

* Only match leading OUs

* Actually, might be best to remove everything except the domain components.
2017-04-12 21:44:09 -05:00
Tony Murray
4b9f3f37d7 fix: move user preferences dashboard and twofactor out of users table (#6286)
* fix: move user preferences dashboard and twofactor out of users table
This allows them to work with any authentication method
Add set_user_pref() and get_user_pref() helper functions

* fix edit users for other users

* Fix updated_at default timestamp

* Update and rename 183.sql to 184.sql

* removed commented out debug
2017-04-01 22:18:00 +01:00
Tony Murray
1ea7af424b feature: bind user for active_directory auth (#6255)
* feature: bind user for active_directory auth
Optional, allows the use of "remember me", API, and alerting.

* missing global (but still may not be working)

* always return a value from reauthenticate()

* Make sure the ldapbind credentials are correct on reauth.
Do not send output if they are incorrect (use d_echo) this breaks ajax calls, etc.
Add scripts/auth_test.php, to make it easier to debug authentication.

* Refine auth_test.php a bit more
A few small cleanups in other places of the auth

* Add auth_test.php to docs
Some more improvements in the auth_test.php output.

* Update Authentication.md
2017-03-29 08:22:02 -05:00
Neil Lathwood
d5296319fb refactor: MySQL strict and query fixes (#5338)
* refactor: MySQL strict and query fixes

* moved sql file
2017-01-13 06:47:16 -06:00
Neil Lathwood
f5ce3c509a Revert "Trust PHP session and remove remember me cookie" (#5252) 2016-12-27 20:37:03 +00:00
Eldon Koyle
3b198243d5 refactor: Trust PHP session and remove remember me cookie (#4608) 2016-12-26 23:11:00 +00:00
jonathon-k
65f74215d3 feature: Add an option for ad authentication to have a default level (#4801)
* Add an option for ad authentication to have a default level

* rework as a flag indicating unspecified access is global read

* Fix indentation
2016-10-21 11:22:13 -05:00
jonathon-k
ba9672b986 fix: Prevent accidental anonymous binds (#4784)
* Prevent ldap and Active Directory authentication from allowing anonymous binds

* fix style
2016-10-13 10:19:36 -05:00
Eldon Koyle
5749179cf5 feature: Add the ability to include an LDAP filter for users/groups in AD (#4494)
* Add auth_ad_(group|user)_filter options

* use global

* Fix some AD annoyances

Use the power of the LDAP filter to minimize the number of queries and
hopefully help performance in get_userlist, change semantics of
auth_ad_(user|group)_filter in $config to be anded with
samaccountname=USERNAME.

* remove unused variable

* update documentation

* Update Authentication.md
2016-09-21 14:42:59 -05:00
Tony Murray
36f6338ad6 fix: Clean up errors in the webui (#4438) 2016-09-15 08:46:26 +01:00
Neil Lathwood
a8efda8f30 Revert "Updated to remove passwords from sessions" (#4422) 2016-09-13 09:10:42 -05:00
Neil Lathwood
deb4b74bc9 webui: remove passwords from sessions, 'remember me' works for all auth types (#4134)
* Updated to remove passwords from sessions

* Remove users sessions when user deleted

* Updated when cookies are set

* Updated setcookies to always contain a value

* Added destroy_cookies() to remove users cookies on failed login

* Removed debug line

* Fixed graph issues
2016-09-12 21:41:19 -05:00
Tony Murray
956e18ffcd feature: Better error messages for ad_auth (#4385) 2016-09-09 08:04:03 -05:00
Tony Murray
8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
Vitali Kari
a175b291c3 reduce regress
still dirty hack, but solves a big problem.
2016-06-15 20:06:36 +02:00
Vitali Kari
0b30ca1071 making CN with a , inside working
a workaround to mask a , sign in a DN before CN is extracted
resolves #3533
2016-06-13 17:25:18 +02:00
Tony Murray
9b0bd4c15a Rename $ds to $ldap_connection
$ds is a global variable, there are many name collisions in the code.  Rename it to avoid the collisions.
2016-06-03 10:56:42 -05:00
Tony Murray
b9448a61a8 Remove Success output from homepage when using AD Auth. 2016-01-25 13:10:51 -06:00
laf
c6c3858312 Some more scrut fixes 2016-01-19 22:27:04 +00:00
laf
44dc6b652b Fixed scrut issues 2016-01-19 09:04:53 +00:00
laf
57c802cd4e Updated active directory auth to support dashboards 2016-01-17 15:26:35 +00:00
Daniel Preussker
340fd75bd5 fix rest of the authmodules 2015-11-21 12:25:34 +00:00
vizay
6e78fc8d0b Update active_directory.inc.php 2015-11-17 12:28:28 +01:00
Peter Lamperud
04c75838f6 Functionality added: adduser(), user_exists_in_db() 2015-11-16 13:37:12 +01:00
Peter Lamperud
f971d7ecf3 Signed-off-by: Peter Lamperud <petlam@unibet.com> 2015-11-16 12:27:15 +01:00
Falk Stern
7c54782cc8 Moved auth_ad_dont_check_certificates to auth_ad_check_certificates 2015-11-16 10:24:16 +01:00
Tony Murray
02d54e9c50 Fix AD auth with untrusted certificates. LDAPTLS_REQCERT=never must be
set before ldap_connect.
2015-11-13 11:05:05 -06:00
Falk Stern
d326869675 Removed unused variables 2015-11-10 10:47:50 +01:00
Falk Stern
16df0fdd2e Coding style 2015-11-10 10:39:42 +01:00
Falk Stern
2326061e68 Removed unused variables and updated coding style 2015-11-10 10:38:42 +01:00
Falk Stern
0eeb4d2ef8 Fixed a bug from scrutinizer 2015-11-10 10:03:47 +01:00
Falk Stern
779c90b1fd Checking for groups now 2015-10-30 17:17:55 +01:00
Falk Stern
93b57040c5 Authenticate against active directory 2015-10-22 09:16:20 +02:00
Falk Stern
a36f3e1e35 Initial commit 2015-10-16 09:40:17 +02:00