我写了一个web项目,部署在tomcat上,测试登录没有问题,可以成功鉴权,
但是当我部署在虚拟机上的tomcat时,鉴权怎么也通不过,看日志信息,好像是session的问题
成功登录的日志:
14:52:40.462 [DEBUG] org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter 312 successfulAuthentication - Authentication success. Updating SecurityContextHolder to contain: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@b91a08a1: Principal: com.bobo.blog.security.MyUserDetails@25a8bba0; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: MAIN_FORWARD, MAIN_INVOKE
14:52:40.462 [DEBUG] org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler 123 determineTargetUrl - Using default Url: /forward
页面跳转鉴权成功的日志(windows上的tomcat)
/forward at position 1 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
14:52:40.477 [DEBUG] org.springframework.security.web.context.HttpSessionSecurityContextRepository 207 readSecurityContextFromSession - Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: 'org.springframework.security.core.context.SecurityContextImpl@b91a08a1: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@b91a08a1: Principal: com.bobo.blog.security.MyUserDetails@25a8bba0; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: MAIN_FORWARD, MAIN_INVOKE'
页面跳转鉴权失败的日志(linux上的tomcat)
2017.11.18-14:27:38.070 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository 174 readSecurityContextFromSession - No HttpSession currently exists
2017.11.18-14:27:38.070 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository 116 loadContext - No SecurityContext was available from the HttpSession: null. A new one will be created.
找不到session然后新建的session,没有权限信息了就。
我也不知道是什么原因。
好绝望,求各位大佬帮助,唯一的区别就是系统环境不一样啊!!