stable

Clone or download

Read-only

LDAP + OIDC accounts are created like LDAP accounts

When an LDAP account is created there are a number of things that are done behind the scenes to guarranty the correctness in all cases (esp. svn). This commit introduce changes in the way accounts are created by ldap plugin so when OIDC Client plugin create accounts, the result is compatible (esp. regarding `ldap_id` and `plugin_ldap_user` tables). This assume that OIDC provider returns an attribute in the `userinfo` route that can be used as `ldap_id`. If such an attribute exists it can be configured with tuleap config-set openidconnectclient_ldap_attribute family_name Some events were converted to objects (instead raw string) to ease the reasonning. The modification of `account_redirect_after_login` (add PFUser as param and pass it in the event was mandatory because when OIDC plugin called this method, at the other side of the event, in ldapPlugin, UserManager::getCurrentUser() was not up to date. Part of request #16607 Allow ldap login when openidconnect client is used Change-Id: I9170d0b3362b8062f4bb4e8ac66b6ffe8b743de8

Modified Files

Name
M plugins/ldap/include/LDAP_User.class.php +11 −12 Go to diff View file
M plugins/ldap/include/LDAP_UserDao.class.php +13 −0 Go to diff View file
M plugins/ldap/include/LDAP_UserManager.class.php +15 −19 Go to diff View file
A plugins/ldap/include/User/AccountCreation.php +59 −0 Go to diff View file
M plugins/ldap/include/WelcomeUpdateController.php +1 −1 Go to diff View file
M plugins/ldap/include/ldapPlugin.php +26 −23 Go to diff View file
M plugins/openidconnectclient/include/OpenIDConnectClient/AccountLinker/Controller.php +1 −1 Go to diff View file
M plugins/openidconnectclient/include/OpenIDConnectClient/Login/Controller.php +12 −7 Go to diff View file
M plugins/openidconnectclient/include/OpenIDConnectClient/Login/Registration/AutomaticUserRegistration.php +51 −12 Go to diff View file
M plugins/openidconnectclient/include/openidconnectclientPlugin.php +9 −2 Go to diff View file
M plugins/openidconnectclient/tests/unit/Login/Registration/AutomaticUserRegistrationTest.php +77 −7 Go to diff View file
M src/common/Event/Event.class.php +0 −8 Go to diff View file
A src/common/User/Account/AccountCreated.php +42 −0 Go to diff View file
A src/common/User/Account/RedirectAfterLogin.php +63 −0 Go to diff View file
M src/common/User/GenericUserFactory.class.php +3 −5 Go to diff View file
M src/common/User/UserManager.class.php +16 −7 Go to diff View file
M src/www/account/login.php +1 −1 Go to diff View file
M src/www/include/account.php +5 −2 Go to diff View file
M tests/unit/common/User/XML/Import/WillBeCreatedUserTest.php +1 −1 Go to diff View file