Jboss 以编程方式登录到Spring安全性时出现问题。JSSession ID附带.undefined suffex
下面是我在应用程序的prog登录中使用的代码Jboss 以编程方式登录到Spring安全性时出现问题。JSSession ID附带.undefined suffex,jboss,jsessionid,Jboss,Jsessionid,下面是我在应用程序的prog登录中使用的代码 UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userName, passWord); token.setDetails(new WebAuthenticationDetails(request)); authentication = authenticati
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userName, passWord);
token.setDetails(new WebAuthenticationDetails(request));
authentication = authenticationManager.authenticate(token);
LOGGER.debug("Logging in with [{}]"+ authentication.getPrincipal());
SecurityContextHolder.getContext().setAuthentication(authentication);
在此之后,将返回一个模型(在不更改URL的情况下,我可以在此处看到usename n角色)。在这个观点上,有一种形式。提交到与当前用户具有相同角色权限的其他链接
但当用户提交表单时,spring将其重定向到登录页面并使会话无效
我已经检查并发现JSSession附加了.undefined(mS5YoJL3YfznQNuItNUeiLd6.undefined),我怀疑这一定是问题所在。我已经检查过,undefined是因为Jboss AS 7.1而来的,而整个问题是因为我在自动登录时没有创建会话。我已经更改了代码,它运行得非常好。感谢您的回复 Spring Security对会话ID没有任何作用。它是。我建议在会话ID中搜索“未定义”。你会发现各种与Jboss相关的讨论。谢谢Luke,我已经检查过了,undefined是因为Jboss AS 7.1而来的,整个问题是因为我在自动登录时没有创建会话。我已经更改了代码,它运行得非常好。谢谢你的回复。