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
0 votes

1 answers

2513 views

ANSWER

Hi Rafi Cohen , could you help me a bit. I wanted to know which login/auth plugin example you are talking about. I am breaking my head to get it working. If you could help me a bit. Thanks
07/27/2017

Rafi Cohen also, you are talking about the log where you could see the plugin getting initialized. which log are you talking about ?
07/27/2017

Also how do you test its working using which API or method ?
07/27/2017



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

0 votes



Does not seem to work: NUXEO_INSTALL/nxserver/config/infinite-auth-config.xml: <component name="com.ikanow.infinit.e.nuxeo.auth.InfiniteAuthenticatorConfig">

&lt;require&gt;org.nuxeo.ecm.platform.ui.web.auth.defaultConfig&lt;/require&gt;
&lt;require&gt;org.nuxeo.ecm.platform.ui.web.auth.WebEngineConfig&lt;/require&gt;

(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 …

10/04/2016

Apology - it does work: I have overlooked the need for the 'version="1.0"' addition, which - according to some other posts - is a must to have this ordering working; once added (and along with the 'require') it works. Thank you very much.
10/17/2016