iron_bo 2017-11-18 07:59 采纳率: 0%
浏览 987
已结题

spring security相关问题

我写了一个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,没有权限信息了就。
我也不知道是什么原因。
好绝望,求各位大佬帮助,唯一的区别就是系统环境不一样啊!!

  • 写回答

1条回答 默认 最新

  • lkl_csdn 2018-07-20 05:56
    关注

    有配置文件吗 光看日志 还不行啊

    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮