103 Star 639 Fork 464

朝雨忆轻尘(Louis) / mango-platform

 / 详情

大佬,我买了您的书,并且学习了您的security部分,但是出现了些问题

Backlog
Opened this issue  
2020-05-22 13:27
  • 如图,在第一次请求的时候是成功的,但是请求第二次就报错,
    输入图片说明
  • 我把security的日志级别改成了debug,出现了几个error
2020-05-22 13:26:51.555 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 1 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2020-05-22 13:26:51.555 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2020-05-22 13:26:51.555 DEBUG 15013 --- [io-8080-exec-14] w.c.HttpSessionSecurityContextRepository : Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: 'org.springframework.security.core.context.SecurityContextImpl@b1bc9dc0: Authentication: cn.mulc.devops.security.JwtAuthenticatioToken@b1bc9dc0: Principal: admin; Credentials: [PROTECTED]; Authenticated: true; Details: null; Granted Authorities: cn.mulc.devops.security.GrantedAuthorityImpl@7430f87f, cn.mulc.devops.security.GrantedAuthorityImpl@7af71889, cn.mulc.devops.security.GrantedAuthorityImpl@7ec8930f, cn.mulc.devops.security.GrantedAuthorityImpl@3bca12b2'
2020-05-22 13:26:51.555 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 3 of 12 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2020-05-22 13:26:51.555 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 4 of 12 in additional filter chain; firing Filter: 'CorsFilter'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 5 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', GET]
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/logout'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', POST]
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /sysMenu/findMenus' doesn't match 'POST /logout'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', PUT]
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /sysMenu/findMenus' doesn't match 'PUT /logout'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', DELETE]
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /sysMenu/findMenus' doesn't match 'DELETE /logout'
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2020-05-22 13:26:51.556 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 6 of 12 in additional filter chain; firing Filter: 'JwtAuthenticationFilter'
1111111111111{sub=admin, exp=1590164744, created=1590121544104, authorities=[{authority=system:dept:list}, {authority=system:menus:list}, {authority=system:user:add}, {authority=system:user:list}]}
2020-05-22 13:26:51.557 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.HttpSessionRequestCache        : saved request doesn't match
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.AnonymousAuthenticationFilter  : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@8ae94304: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: D34B5C886076C0581B6EE2EDBF126A7C; Granted Authorities: ROLE_ANONYMOUS'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /sysMenu/findMenus at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /sysMenu/findMenus' doesn't match 'OPTIONS /**'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/webjars/**'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/druid/**'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/login'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/swagger-ui.html'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/swagger-resources/**'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/v2/api-docs'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/captcha/get'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/captcha/check'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/captcha/verify'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/actuator/**'
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.i.FilterSecurityInterceptor    : Secure object: FilterInvocation: URL: /sysMenu/findMenus; Attributes: [authenticated]
2020-05-22 13:26:51.558 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.i.FilterSecurityInterceptor    : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@8ae94304: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: D34B5C886076C0581B6EE2EDBF126A7C; Granted Authorities: ROLE_ANONYMOUS
2020-05-22 13:26:51.559 DEBUG 15013 --- [io-8080-exec-14] o.s.s.access.vote.AffirmativeBased       : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@3dc18e81, returned: -1
2020-05-22 13:26:51.559 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.ExceptionTranslationFilter     : Access is denied (user is anonymous); redirecting to authentication entry point

org.springframework.security.access.AccessDeniedException: Access is denied
	at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84) ~[spring-security-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233) ~[spring-security-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:123) ~[spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) ~[spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) ~[spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at cn.mulc.devops.security.JwtAuthenticationFilter.doFilterInternal(JwtAuthenticationFilter.java:34) [classes/:na]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:92) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) [spring-security-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_221]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_221]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.31.jar:9.0.31]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_221]

2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : Trying to match using NegatedRequestMatcher [requestMatcher=Ant [pattern='/**/favicon.*']]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/sysMenu/findMenus'; against '/**/favicon.*'
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.NegatedRequestMatcher  : matches = true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : Trying to match using NegatedRequestMatcher [requestMatcher=MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@4dbcaf07, matchingMediaTypes=[application/json], useEquals=false, ignoredMediaTypes=[*/*]]]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : httpRequestMediaTypes=[*/*]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Processing */*
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Ignoring
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Did not match any media types
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.NegatedRequestMatcher  : matches = true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : Trying to match using NegatedRequestMatcher [requestMatcher=RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.NegatedRequestMatcher  : matches = true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : Trying to match using NegatedRequestMatcher [requestMatcher=MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@4dbcaf07, matchingMediaTypes=[multipart/form-data], useEquals=false, ignoredMediaTypes=[*/*]]]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : httpRequestMediaTypes=[*/*]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Processing */*
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Ignoring
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Did not match any media types
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.NegatedRequestMatcher  : matches = true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : Trying to match using NegatedRequestMatcher [requestMatcher=MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@4dbcaf07, matchingMediaTypes=[text/event-stream], useEquals=false, ignoredMediaTypes=[*/*]]]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : httpRequestMediaTypes=[*/*]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Processing */*
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Ignoring
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.m.MediaTypeRequestMatcher      : Did not match any media types
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.NegatedRequestMatcher  : matches = true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.util.matcher.AndRequestMatcher   : All requestMatchers returned true
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.HttpSessionRequestCache        : DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/sysMenu/findMenus]
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.ExceptionTranslationFilter     : Calling Authentication entry point.
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.Http403ForbiddenEntryPoint     : Pre-authenticated entry point called. Rejecting access
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.header.writers.HstsHeaderWriter  : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@59212890
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2020-05-22 13:26:51.560 DEBUG 15013 --- [io-8080-exec-14] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 1 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] w.c.HttpSessionSecurityContextRepository : HttpSession returned null object for SPRING_SECURITY_CONTEXT
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@2953724b. A new one will be created.
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 3 of 12 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 4 of 12 in additional filter chain; firing Filter: 'CorsFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 5 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', GET]
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/error'; against '/logout'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', POST]
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /error' doesn't match 'POST /logout'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', PUT]
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /error' doesn't match 'PUT /logout'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', DELETE]
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'GET /error' doesn't match 'DELETE /logout'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 6 of 12 in additional filter chain; firing Filter: 'JwtAuthenticationFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.DefaultSavedRequest            : pathInfo: both null (property equals)
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.DefaultSavedRequest            : queryString: both null (property equals)
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.DefaultSavedRequest            : requestURI: arg1=/sysMenu/findMenus; arg2=/error (property not equals)
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.s.HttpSessionRequestCache        : saved request doesn't match
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.AnonymousAuthenticationFilter  : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@8ae94304: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: D34B5C886076C0581B6EE2EDBF126A7C; Granted Authorities: ROLE_ANONYMOUS'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2020-05-22 13:26:51.561 DEBUG 15013 --- [io-8080-exec-14] o.s.security.web.FilterChainProxy        : /error reached end of additional filter chain; proceeding with original chain
2020-05-22 13:26:51.562 DEBUG 15013 --- [io-8080-exec-14] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2020-05-22 13:26:51.563 DEBUG 15013 --- [io-8080-exec-14] o.s.s.w.a.ExceptionTranslationFilter     : Chain processed normally
2020-05-22 13:26:51.563 DEBUG 15013 --- [io-8080-exec-14] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

Comments (2)

许子龙 created任务
许子龙 changed description
Expand operation logs

SecurityUtils的getUsername()方法有问题,修改成这样:

public static String getUsername() {
    String username = null;
    Authentication authentication = getAuthentication();
    if (authentication != null) {
        if (authentication instanceof AnonymousAuthenticationToken) {
            return null;
        }
        if (authentication instanceof UsernamePasswordAuthenticationToken || authentication instanceof UserDetails) {
            username = authentication.getName();
        }
    }
    return username;
}

SecurityUtils的getUsername()方法有问题,修改成这样:

public static String getUsername() {
String username = null;
Authentication authentication = getAuthentication();
if (authentication != null) {
if (authentication instanceof AnonymousAuthenticationToken) {
return null;
}
if (authentication instanceof UsernamePasswordAuthenticationToken || authentication instanceof UserDetails) {
username = authentication.getName();
}
}
return username;
}

@auhil 好的,谢谢大佬,我试一下

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
Java
1
https://gitee.com/liuge1988/mango-platform.git
git@gitee.com:liuge1988/mango-platform.git
liuge1988
mango-platform
mango-platform

Search