39234[!!!][FEATURE] BE Login form API
Commit message
Review
-
Code review CR +2
- Anja Leichsenring +2
- Markus Klein +1
- Frank Nägler +1
- Christian Kuhn +1
-
Verified V +2
- Anja Leichsenring +2
- Markus Klein +1
- Frank Nägler +1
- Christian Kuhn +1
Issues 1
Files 29
- typo3/sysext/backend/Classes/Controller/LoginController.php60+236 −310
- typo3/sysext/backend/Classes/LoginProvider/LoginProviderInterface.php2new+47 −0
- typo3/sysext/backend/Classes/LoginProvider/UsernamePasswordLoginProvider.phpnew+50 −0
- typo3/sysext/backend/Resources/Private/Language/locallang.xlf+48 −0
- typo3/sysext/backend/Resources/Private/Layouts/Login.html2new+112 −0
- typo3/sysext/backend/Resources/Private/Partials/Login/InterfaceSelector.htmlnew+17 −0
- typo3/sysext/backend/Resources/Private/Partials/LoginNews.htmlnew+21 −0
- typo3/sysext/backend/Resources/Private/Templates/Login.html2deleted+0 −164
- typo3/sysext/backend/Resources/Private/Templates/UserPassLoginForm.htmlnew+24 −0
- typo3/sysext/backend/Resources/Public/JavaScript/Login.js3+12 −161
- typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.jsnew+95 −0
- typo3/sysext/backend/Tests/Unit/Controller/LoginControllerTest.phpnew+144 −0
- typo3/sysext/backend/ext_localconf.php1+7 −0
- typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php+0 −1
- typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php+0 −5
- typo3/sysext/core/Documentation/Changelog/master/Breaking-66669-BackendLoginControllerRefactored.rstnew+38 −0
- typo3/sysext/core/Documentation/Changelog/master/Feature-66669-BeLoginFormAPI.rst8new+98 −0
- typo3/sysext/lang/locallang_login.xlf+18 −0
- typo3/sysext/openid/Classes/LoginProvider/OpenIdLoginProvider.phpnew+40 −0
- typo3/sysext/openid/Resources/Private/Language/locallang.xlf+6 −0
Show 9 more files
- typo3/sysext/openid/Resources/Private/Templates/OpenidLogin.htmlnew+12 −0
- typo3/sysext/openid/ext_localconf.php6+7 −0
- typo3/sysext/rsaauth/Classes/Hook/LoginFormHook.phpdeleted+0 −61
- typo3/sysext/rsaauth/Classes/Slot/UsernamePasswordProviderSlot.phpnew+47 −0
- typo3/sysext/rsaauth/Resources/Public/JavaScript/BackendLoginFormRsaEncryption.js+8 −7
- typo3/sysext/rsaauth/ext_localconf.php1+7 −2
- typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_login_screen.less+3 −3
- typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css+2 −2
- typo3/index.php+0 −1
Review log 97
Show 72 earlier messages
-
Helmut Hummel uploaded patch set 1 05/03/15, 11:42
-
Frank Nägler uploaded patch set 2 05/03/15, 14:18
-
Frank Nägler uploaded patch set 3 05/03/15, 15:11
-
Frank Nägler uploaded patch set 4 05/03/15, 15:22
-
Torben Hansen uploaded patch set 5 05/03/15, 17:44
-
Torben Hansen commented on patch set 5 05/03/15, 17:54
Great work! Tested with my YubiKey 2FA extension and it works as expected. -
Markus Klein commented on patch set 5 CR -1 05/03/15, 18:19
Dislike.. writing to Helmut in Slack. -
Frank Nägler uploaded patch set 6 05/14/15, 19:07
-
Frank Nägler uploaded patch set 7 05/14/15, 19:10
-
Frank Nägler commented on patch set 7 05/14/15, 19:10
this patch is still WIP and we need to change some more things. -
Frank Nägler uploaded patch set 8 05/14/15, 19:18
-
Markus Klein commented on patch set 8 05/15/15, 12:40
What do you think about kicking the whole challenged stuff in a separate patch first? lets create a subtask on forge for that. Steps would be: * kick challenged stuff from Core * remove openid parts from current belogin * bring new API to live * re-implement usernamepassword-provider * re-implement openid-provider[WIP][!!!][FEATURE] BE Login form APILoginController.php:119provider -
Markus Klein commented on patch set 8 CR -1 05/16/15, 00:09
This is the removal of (super)challenged https://review.typo3.org/39576 -
Frank Nägler uploaded patch set 9 05/17/15, 14:19
-
Frank Nägler commented on patch set 9 CR -2 05/17/15, 14:20
still wip -
Frank Nägler uploaded patch set 10 05/18/15, 21:36
-
Markus Klein commented on patch set 10 CR -1 05/18/15, 22:12
Login.js:94you duplicated that code!Feature-66669-AddEextensionPointsToLoginTemplate.rst:2needs to be completely rewrittenOpenidProvider.php:36should be "Openid" right?ext_localconf.php:51this is not needed. php generates the intermediate array without notices or warnings -
Markus Klein commented on patch set 10 05/18/15, 22:26
I'd change the systematic a bit. I'd provide a Login-Layout by the Core and all providers have to use it in their Fluid templates. I'd make the rsaauth provider extend the usernamepassword-provider and override its registration completely in ext_localconfLoginController.php:307phpdoc: first paragraph is function title so a empty line must be added before thisLoginController.php:389would extract that to some sort of API as well. no help to have this hardcoded here. but maybe in a followup patch then.LoginController.php:503what is this good for? I wouldn't provide such a thing at all.LoginController.php:595boolLoginProviderInterface.php:23description missing. we need to precisely describe what each methods has to be used for.UsernamePasswordProvider.php:25not neededLogin.html:59create a partial for that? -
Markus Klein commented on patch set 10 05/18/15, 22:32
LoginController.php:137what if backend is not available? I'd take the one with the highest sorting numberLoginController.php:271we should check the interface before creating the instance at all.LoginController.php:272disagree here. we do not let any registered provider interfere with other. We only render the one selected, we shouldn't even instantiate another one.LoginController.php:280as commented in another file: lets not create a dedicated view for the provider, but use $this->view and let the provider specify the layout we provide. -
Frank Nägler commented on patch set 10 05/19/15, 08:20
on it -
Frank Nägler commented on patch set 10 05/19/15, 10:06
will push a new patchset later, still on itLoginController.php:137ReplyDoneLoginController.php:307ReplyDoneLoginController.php:389Replythis should be part of a followup, the interfaces (frontend and backend) hardcoded since years. This should be refactored later with the possibility to extend the interfaces, I think it would make sense to add custom interfaces or "jump points", e.g. jump to Page "Foo" or Page "Bar" in FE.LoginController.php:503Replywill be removed before merge, I used this method to make all public properties protected. after I have checked all properties, this and the __set method will be removed.LoginController.php:595ReplyDoneLoginProviderInterface.php:23ReplyDoneUsernamePasswordProvider.php:25ReplyDoneLogin.html:59ReplyDoneLogin.js:94ReplyDoneOpenidProvider.php:36ReplyDoneext_localconf.php:51ReplyDone -
Frank Nägler uploaded patch set 11 05/19/15, 22:38
-
Frank Nägler commented on patch set 10 05/19/15, 22:39
LoginController.php:271ReplyDoneLoginController.php:272ReplyDoneLoginController.php:280ReplyDone -
Frank Nägler uploaded patch set 12 05/19/15, 22:48
-
Markus Klein uploaded patch set 13 05/20/15, 02:29
-
Markus Klein commented on patch set 12 05/20/15, 02:29
All fixed in set 13LoginController.php:26unused importsLoginController.php:239I'll kick thatLoginController.php:248this option does not exist anymoreLoginController.php:262why removing that? does not hurt us, let's bring it back.LoginController.php:265, TRUELoginController.php:265CGLLoginController.php:269why do we actually need 2 methods? IMO 1 sufficesLoginController.php:284kicking this function as wellLoginController.php:351I actually want to get rid of this code somehow. maybe a followupLoginController.php:380The language file is not yet loaded here, due to the move of the get..template() function in the main() functionLoginController.php:458No label of this file is used via global $lang.LoginController.php:477variable namingLoginController.php:480no need to run the loop for only a single run.LoginController.php:499The classical.... Math is the solution: return $b['sorting']-$a['sorting']LoginController.php:515bad practise: throw an exception hereLogin.html:9we can compare strings directly already for quite some time. ;-)Login.js:210this JS should go into the dedicated JS for the usernamepasswordproviderext_localconf.php:23Resources... fileext_localconf.php:53Resources... fileext_localconf.php:39only override the provider here, the remainder must be preserved -
Markus Klein commented on patch set 13 CR +1 V +1 05/20/15, 02:36
todo: feature rstFeature-66669-BeLoginFromAPI.rst:8don't forget this -
Markus Klein commented on patch set 13 05/20/15, 09:30
LoginController.php:242even better maybe: is_subclass_of -
Andreas Kienast commented on patch set 13 05/20/15, 09:38
LoginController.php:242Reply+1 for is_subclass_of, there is no need to get an array -
Frank Nägler uploaded patch set 14 05/20/15, 21:15
-
Frank Nägler commented on patch set 13 05/20/15, 21:15
LoginController.php:242ReplyDoneLoginController.php:242ReplyDoneFeature-66669-BeLoginFromAPI.rst:8ReplyDone -
Frank Nägler voted on patch set 14 CR 0 05/20/15, 21:16
-
Markus Klein uploaded patch set 15 05/20/15, 21:41
-
Markus Klein voted on patch set 15 CR +2 V +1 05/20/15, 21:42
-
Markus Klein uploaded patch set 16 05/20/15, 22:01
-
Markus Klein commented on patch set 16 V +1 CR +2 05/20/15, 22:02
Updated Breaking rst -
Frank Nägler commented on patch set 16 05/20/15, 22:03
@Torben can you test the patch with your extension? -
Xavier Perseguers commented on patch set 16 CR -1 05/21/15, 07:00
LoginController.php:460We already have a global key for backend related information: "BE", please reuse that. Furthermore, this looks like configuration of the "backend" extension, and as such it belongs to $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend'] -
Frank Nägler commented on patch set 16 05/21/15, 07:28
LoginController.php:460Replythx, looks like a mistake, should be $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend'] ... -
Frank Nägler uploaded patch set 17 05/21/15, 10:47
-
Markus Klein voted on patch set 17 CR +1 V +1 05/21/15, 10:59
-
Torben Hansen commented on patch set 17 05/21/15, 11:01
The new concept does not cover the situation of having multiple LoginProviders extending the same class (e.g. UsernamePasswordLoginProvider). With the new patch, it is only possible to extend the UsernamePasswordLoginProvider once. Typically, RSA Auth already extends UsernamePasswordLoginProvider, so when I register my LoginProvider (which also extends UsernamePasswordLoginProvider by adding a third field to the login screen) the render function of the RsaAuthLoginProvider gets overridden by my LoginProvider. This results in the situation, that it is not possible to login any more, since the RSA Auth process fails. I could resolve the problem by extending RsaAuthLoginProvider instead of UsernamePasswordLoginProvider. But when a user uninstalls rsaauth or adds another authservice, which also extends UsernamePasswordLoginProvider (edgecase of course), the login functionality will be broken. Is this intended to work so? -
Markus Klein commented on patch set 17 05/21/15, 12:02
Thanks for sharing your usecase here. This is indeed not easily doable. Generally your usecase would be doable if rsaauth would plugin differently, right? You could then just extend the default login and you're done. -
Torben Hansen commented on patch set 17 05/21/15, 12:19
Yes, if rsaauth would plugin differently, I could just extend the default login. -
Markus Klein commented on patch set 17 05/21/15, 13:14
But you actually only need to adjust the HTML template, right? So having a possibility to replace the form HTML of the default login, would already do the job. -
Torben Hansen commented on patch set 17 05/21/15, 15:19
Yes, I only need to add an additional field to the HTML Template. I also use $TBE_STYLES['stylesheet2'] to add an additional CSS file to the TYPO3 installation. I emailed with an extension author this week, who used $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'] to add additional JS to the backend login in order to implement a FIDO U2F authentication for the backend login. Instead of using the loginScriptHook, the extension author could use an own LoginProvider to add extra fields and JS files. So in gereral I think it is required to extend the login form with custom HTML (e.g. a field), additional JS and CSS. -
Markus Klein commented on patch set 17 V 0 CR -2 05/21/15, 15:31
Ok seems like extending the default login form is more common than I expected. I expected that you will mostly replace the whole form anyway. I'll talk with Frank again about the concept. I consider shifting rsaauth out of the class hierarchy, such that you can directly extend the default login, with your own login. That would open all doors then for HTML, JS and CSS modifications and still there would be some way to inject rsaauth. Will report back here. -
Frank Nägler commented on patch set 17 05/21/15, 20:50
Possible solution with the current implementation would be: if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rsaauth')) { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend'][\TYPO3\CMS\Backend\Controller\LoginController::class]['loginProviders']['backend']['provider'] = \TYPO3\CMS\Foo\LoginProvider\FooRsaAuthLoginProvider::class; } else { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend'][\TYPO3\CMS\Backend\Controller\LoginController::class]['loginProviders']['backend']['provider'] = \TYPO3\CMS\Foo\LoginProvider\FooUsernamePasswordLoginProvider::class; } for that @FooRsaAuthLoginProvider@ must extend @RsaAuthLoginProvider@ and @FooUsernamePasswordLoginProvider@ must extend @UsernamePasswordLoginProvider@ -
Frank Nägler uploaded patch set 18 05/21/15, 22:23
-
Markus Klein uploaded patch set 19 05/21/15, 22:40
-
Markus Klein voted on patch set 18 CR 0 05/21/15, 22:41
-
Markus Klein voted on patch set 19 CR 0 05/21/15, 22:41
-
Markus Klein voted on patch set 19 CR +1 V +1 05/21/15, 22:44
-
Markus Klein uploaded patch set 20 05/21/15, 22:47
-
Markus Klein voted on patch set 20 CR +1 V +1 05/22/15, 00:29
-
Andreas Kienast uploaded patch set 21 05/22/15, 06:40
-
Andreas Kienast commented on patch set 21 CR +1 V +1 05/22/15, 06:40
Sorry, found a nitpick. -
Torben Hansen commented on patch set 21 V +1 05/22/15, 10:37
Feature-66669-BeLoginFormAPI.rst:29rsaauth does'nt extend another LoginProvider anymore. Should we provide an additional section in this document describing how to extend an existing LoginProvider?Feature-66669-BeLoginFormAPI.rst:79two -
Markus Klein commented on patch set 21 CR -1 05/22/15, 13:33
Feature-66669-BeLoginFormAPI.rst:29ReplyWe proof-read this now. We were too tired obviously to get it right. -
Markus Klein uploaded patch set 22 05/22/15, 13:40
-
Markus Klein voted on patch set 22 CR +1 V +1 05/22/15, 13:40
-
Frank Nägler uploaded patch set 23 05/22/15, 13:54
-
Frank Nägler commented on patch set 23 05/22/15, 13:54
only small fix in rst file -
Markus Klein voted on patch set 23 CR +1 V +1 05/22/15, 15:19
-
Christian Kuhn commented on patch set 23 05/22/15, 23:58
just skimmed roughly, did not yet do a full review and gerrit is shaky currently ... i'll try to give this a full review soon.LoginController.php:448could we hard code a name here instead of __CLASS__? Furthermore, I have similar code in NodeFactory of https://review.typo3.org/#/c/39662/2/typo3/sysext/backend/Classes/Form/NodeFactory.php - and my code is more defensive (eg. I sanitize the parameters and throw exceptions if the registration is incomplete. -
Torben Hansen voted on patch set 23 V +1 05/26/15, 12:38
-
Frank Nägler commented on patch set 23 CR -1 05/29/15, 15:52
waiting of feedback by LolliLoginController.php:448ReplyWhat is the reason for not using __CLASS__ ? We use it many times in the core. I am fine to check the data and throw an exception, this is a good practice. -
Helmut Hummel commented on patch set 23 05/30/15, 09:58
LoginController.php:448Reply> What is the reason for not using __CLASS__ ? It is a configuration key, which should not change once the class name changes (although this would be very unlikely). Besides that, it is more explicit to read if the configuration key would written here. At least we should use: TYPO3\CMS\Backend\Controller\LoginController::class as key. -
Frank Nägler commented on patch set 23 05/30/15, 13:18
LoginController.php:448ReplyDone -
Frank Nägler uploaded patch set 24 05/30/15, 13:20
-
Markus Klein voted on patch set 24 CR +1 V +1 05/30/15, 22:28
-
Torben Hansen voted on patch set 24 V +1 05/31/15, 08:05
-
Andreas Kienast voted on patch set 24 CR +1 V +1 05/31/15, 17:58
-
Christian Kuhn commented on patch set 24 CR -1 06/03/15, 15:37
working on it. -
Christian Kuhn commented on patch set 24 06/03/15, 16:13
some comments - i'd slightly change the interface and code some areas a bit more defensive.LoginController.php:230mmmh, fishy. is this some kind of fallback if a loginProvider was unloaded and you reload to not fatal? if not, please remove class_exists() and throw and exception if not "instanceof" interface.LoginController.php:329!empty()LoginController.php:448to my understanding, there *must* be some login provider that is registered, right? throw an exception on empty() ?LoginController.php:450throw an exception if sorting is not set? What else is mandatory? prodiver for sure, icon-class? label?LoginController.php:463Sorry, I'm still no fan of \TYPO3\CMS\Backend\Controller\LoginController::class ... couldn't we just remove the whole key? isn't backend/loginProviders enough??Feature-66669-BeLoginFormAPI.rst:2good file! thx!ext_localconf.php:49btw: instead of text string "openid" as key, i took a timestamp at different places. this way it will not clash with others, it shows the key is "irrelevant", naming conflicts are easy, you don't need to think about at and still, the entry is at a specific not changing position in the array. what do you think? -
Frank Nägler commented on patch set 24 06/03/15, 16:25
LoginController.php:230Replyexception is a good ideaLoginController.php:329Replyno, the check is > 1LoginController.php:448Replylike before, a good idea, will change itLoginController.php:450Replywill check itLoginController.php:463ReplyI am fine, we can change it.ext_localconf.php:49Replythe idea is that you can extend or remove providers, a speaking key is imo nicer in this case. e.g. you can provide an extension super_openid, which extends/replace the origin provider. -
Markus Klein commented on patch set 24 06/03/15, 16:27
LoginController.php:230ReplyNo fallback intended. Just a validation. An exception might indeed be better.LoginController.php:329ReplyNo: count() > 1 != !emptyLoginController.php:448Replythat should be checked outside of this function. its sole purpose is to return what is there.LoginController.php:450ReplyThe validation should not happen in the closure.LoginController.php:463Replywe found no better alternative yet. but I've no problem with skipping the intermidate part.ext_localconf.php:49ReplyI'm a bit worried about the readability of "only numbers" -
Markus Klein uploaded patch set 25 06/04/15, 12:28
-
Markus Klein commented on patch set 25 V -1 CR +1 06/04/15, 12:30
the last used provider shall be restored. will add this. -
Markus Klein uploaded patch set 26 06/04/15, 12:50
-
Markus Klein voted on patch set 26 CR +1 V +1 06/04/15, 12:51
-
Markus Klein commented on patch set 26 CR 0 V 0 06/04/15, 13:03
LoginController.php:110needs validation as this is written to uc.LoginController.php:114only used once, can be removed -
Markus Klein uploaded patch set 27 06/04/15, 13:14
-
Markus Klein commented on patch set 27 CR +1 V +1 06/04/15, 13:16
LoginController.php:259This needs some more thoughts. We do this in a followup as this is not critical. -
Torben Hansen voted on patch set 27 V +1 06/04/15, 19:02
-
Christian Kuhn voted on patch set 27 CR +1 06/04/15, 19:47
-
Christian Kuhn voted on patch set 27 V +1 06/04/15, 19:48
-
Frank Nägler voted on patch set 27 V +1 CR +1 06/04/15, 19:50
-
Anja Leichsenring commented on patch set 27 06/04/15, 20:02
Feature-66669-BeLoginFormAPI.rst:61objectFeature-66669-BeLoginFormAPI.rst:62may -> must. This is imperative, no option. -
Markus Klein commented on patch set 27 06/04/15, 20:20
Feature-66669-BeLoginFormAPI.rst:61ReplyYou have to set it within the method of the object implementing the interface.Feature-66669-BeLoginFormAPI.rst:62ReplyAgreed. -
Anja Leichsenring uploaded patch set 28 06/04/15, 20:26
-
Markus Klein voted on patch set 28 CR +1 V +1 06/04/15, 20:28
-
Frank Nägler voted on patch set 28 V +1 CR +1 06/04/15, 20:28
-
Anja Leichsenring voted on patch set 28 CR +2 V +2 06/04/15, 21:20
-
Christian Kuhn voted on patch set 28 CR +1 V +1 06/04/15, 21:58
-
Anja Leichsenring merged patch set 28 06/05/15, 05:04
-
Benni Mack commented on patch set 29 10/04/17, 08:18
Login.html:54this strikes me as being plainly wrong, as it redirects to a relative file within the server...