I previously had some code working on Glassfish, but I want to put it in WildFly.
However, I cannot force the module to be called by WildFly. ServletContextListener initializes the module as follows:
AuthConfigFactory.getFactory ()
.registerConfigProvider (new OpenIdConnectModuleConfigProvider (options, null),
"HttpServlet", getAppContext (sce), null);
"HttpServlet" not specific to Glassfish and appears to refer to https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/security/jaspi /JASPIAuthenticationMechanism.java?source=cc
Glassfish does not require a <logon-config> block on web.xml and puts any option in WildFly not working (as expected)
In another place that I suspect, I compute the application context identifier. For Glassfish, I had
private String getAppContext(final ServletContextEvent sce) { return sce.getServletContext() .getVirtualServerName() + " " + sce.getServletContext() .getContextPath(); }
Could it be different in WildFly? Although I saw similar code in https://github.com/rdebusscher/secSpikeWeb/blob/master/src/main/java/org/omnifaces/security/jaspic/core/Jaspic.java#L300 as well
I also tried adding this block to standalone.xml
<security-domain name="jaspi" cache-type="default"> <authentication-jaspi> <login-module-stack name="dummy"> <login-module code="Dummy" flag="optional"/> </login-module-stack> <auth-module code="org.wildfly.extension.undertow.security.jaspi.modules.HTTPSchemeServerAuthModule" flag="required"/> </authentication-jaspi> </security-domain>
And set <default-security-domain value="jaspi"/>
However, this did not affect, and setting a breakpoint in the module did not show that it also hits.
Also, I could not find a way to do the following in WildFly, like in glassfish-web.xml , but this might be another question
<security-role-mapping> <role-name>users</role-name> <group-name>https://helloworld</group-name> </security-role-mapping>
The code is quite large, but its essence can be found in
https://github.com/trajano/openid-connect/tree/openid-connect-1.0.1/openid-connect-jaspic-module
and
https://github.com/trajano/openid-connect/tree/openid-connect-1.0.1/openid-connect-jaspic-sample
Note. I am looking for it at the application level and do not install a global JASPI server.