我已将我的j老板7.1更新为野蝇8.2。但是相同的战争文件仍在7.2上运行,但在野蝇8.2中却没有。我在身份验证时遇到问题。战争在WF 8.2中完美部署。
web.xml
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- <security-constraint>
<web-resource-collection>
<web-resource-name>AgencyPortalUI</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint> -->
<session-config>
<!-- 15 minutes 900000 milliseconds -->
<session-timeout>100</session-timeout>
</session-config>
</web-app>
和我的jboss配置,与wildfly相同
<security-domains>
<security-domain name="other" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmDirect" flag="optional">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
<security-domain name="jboss-web-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
<security-domain name="jboss-ejb-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
</security-domains>
</subsystem>
和我的代码
try {
LOGGER.info("before authenticate {}");
userTO = restEasyPortalServiceProxy.getLoginService().authenticate(
userName, userPass);
LOGGER.info("After authenticate : {}", userTO);
userSessionData.setAuthToken(userTO.getAuthToken());
}