<div dir="ltr">Hello all, having an issue with a custom io.undertow.security.api.AuthenticationMechanism implementation and EJB security on WildFly 8.2 and hoping someone can think of a work around.<div><br></div><div>Basic problem, user is authenticated via the AuthenticationMechanism, and the web context sees the user just fine and their roles, but when we get to the EJB calls the user is seen as &#39;anonymous&#39;. The mechanism calls:</div><div><br></div><div><font face="monospace, monospace">sc.authenticationComplete(ac, mechanismName, true);</font><br></div><div>and returns:</div><div><font face="monospace, monospace">AuthenticationMechanismOutcome.AUTHENTICATED;</font><br></div><div><br></div><div>The resources I&#39;m calling are configured as being protected through the web.xml and all of that is working as expected.</div><div><br></div><div>Another note, I am able to get this to work in WildFly 10.1, but only with (what I think is) a bit of hack. The following code is required for EJB Security to work:</div><div><br></div><div><div><font face="monospace, monospace">    sc.authenticationComplete(ac, mechanismName, true);</font></div><div><font face="monospace, monospace">    sc.login(ac.getUsername(), &quot;&quot;);</font></div><div><font face="monospace, monospace">    sc.authenticate();</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">This same code in 8.2 causes an infinite recursion issue. Even working around that (with another hack) this still doesn&#39;t work.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Any ideas would be greatly appreciated. Upgrading is going to be considered a worst case scenario right now, and would like avoid it right now if at all possible.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks for the help!</font></div><div><font face="arial, helvetica, sans-serif">-Nick</font></div></div>