authenticationChain of my plugin is overridden by org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig
I am trying to test a login/auth plugin example, which (among other things) alters the authenticationChain (in order to add itself), and yet it seems it does not 'kick in' or being used, i.e. the log shows both its auth-plugin and login-plugin are initialized, and yet when I try to log in, they do not get involved in the auth/login process. looking at the log, it seems the alteration the auth plugin makes to authenticationChain are overridden by org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig (from the log):
[org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:org.nuxeo.ecm.platform.your.authentication.chain.config
...
[org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:org.nuxeo.ecm.platform.ui.web.auth.defaultConfig
...
[org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:com.ikanow.infinit.e.nuxeo.auth.InfiniteAuthenticator <<< NOTE THIS IS THE PLUGIN-EXAMPLE I AM TRYING TO TEST ALTERING THE CHAIN, so that it would be able to perform its task
...
[org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig <<< AND YET HERE THE ALTERATION MADE ABOVE IS OVERRIDDEN
...
Could anyone please advise on how to resolve this issue ?
p.s. just discovered that if I rename the plugin bundle to start with a 'Z' it gets loaded last, and as such its auth-chain 'prevails' (at the cost of overwriding WebEngine chain changes, of course). about to try adding 'order' to the plugin (i.s. as another alternative, instead of renaming the bundle) to see if it will also work. Further tests results:
- (as mentioned above) renaming the bundle name: the test-plugin chain alteration is the last to be applied
- renaming the config-file of the bundle (under NUXEO_INSTALL/nxserver/config) in the same way: WebEngine chain alteration is the last to be applied
- adding 'order = “9999”' to the test plugin: WebEngine chain alteration is the last to be applied
Hi Rafi,
Try to add this line in your xml contrib file:
<component name="yourComponent" version="1.0">
<require>org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig</require>
...
Jihad
<require>org.nuxeo.ecm.platform.ui.web.auth.defaultConfig</require>
<require>org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig</require>
…
(restarted Nuxeo) server.log: … 2016-10-04 14:01:32,032 DEBUG [localhost-startStop-1] [org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:com.ikanow.infinit.e.nuxeo.auth.InfiniteAuthenticator … 2016-10-04 14:01:34,812 DEBUG [localhost-startStop-1] [org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService] New authentication chain powered by service:org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig …