我试图在Spring Boot + Spring MVC应用程序中设置CAS身份验证,但是有些东西丢失了,我无法弄清楚。
截至目前,我的应用程序启动了,我可以成功浏览不受auth保护的控制器页面(页面渲染正常)。当我尝试浏览受保护的页面时,我被正确地重定向到我的CAS登录页面,输入我的登录/通行证,并正确地发送回我的应用程序。但是,我得到404错误。
我被送回http://localhost:8080/cas/j_spring_cas_security_check?ticket=ST-16627-0xpiyvJ2xJojjKEIerUd,页面显示:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Sep 04 10:14:55 BRT 2015
There was an unexpected error (type=Not Found, status=404).
Not Found
我想应该有一个映射来处理http://localhost:8080/cas/j_spring_cas_security_check?ticket=并且它丢失了,所以我得到了404。
我的Spring Boot应用程序是这样的:
主要课程:
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(ApplicationConfiguration.class, args);
}
}
然后是ApplicationConfiguration:
@Configuration
@EnableWebSecurity
@EnableWebMvcSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService("http://localhost:8080/cas/j_spring_cas_security_check");
serviceProperties.setSendRenew(false);
return serviceProperties;
}
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
casAuthenticationProvider.setAuthenticationUserDetailsService(authenticationUserDetailsService());
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(cas20ServiceTicketValidator());
casAuthenticationProvider.setKey("my_app_key");
return casAuthenticationProvider;
}
@Bean
public AuthenticationUserDetailsService authenticationUserDetailsService() {
return new UserDetailsServiceImpl();
}
@Bean
public Cas20ServiceTicketValidator cas20ServiceTicketValidator() {
return new Cas20ServiceTicketValidator("https://login.mydomain.com/cas/");
}
@Bean
public CasAuthenticationFilter casAuthenticationFilter() throws Exception {
CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
casAuthenticationFilter.setAuthenticationManager(authenticationManager());
return casAuthenticationFilter;
}
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setLoginUrl("https://login.mydomain.com/cas/login");
casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
return casAuthenticationEntryPoint;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.addFilter(casAuthenticationFilter());
http.exceptionHandling().authenticationEntryPoint(casAuthenticationEntryPoint());
http.csrf().disable();
http.authorizeRequests()
.antMatchers("/home").authenticated()
//.anyRequest().authenticated()
;
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(casAuthenticationProvider());
}
}
也是UserDetailsServiceImpl:
public class UserDetailsServiceImpl implements AuthenticationUserDetailsService {
@Override
public UserDetails loadUserDetails(Authentication token) throws UsernameNotFoundException {
User user = new User(token.getName(), "ROLE_DEFAULT");
return user;
}
}
和我的控制器,带有受保护的(/ home)和不受保护的(/索引)页面:
@Controller
public class HomeController {
@RequestMapping("/home")
public String home() {
return "home";
}
@RequestMapping("/index")
public String index() {
return "index";
}
}
当我最初尝试访问/ home时,我的日志显示:
[DEBUG] [2015-09-04 10:40:47,081] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
[DEBUG] [2015-09-04 10:40:47,082] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
[DEBUG] [2015-09-04 10:40:47,082] [] [o.s.s.w.c.HttpSessionSecurityContextRepository->readSecurityContextFromSession:140] | No HttpSession currently exists
[DEBUG] [2015-09-04 10:40:47,082] [] [o.s.s.w.c.HttpSessionSecurityContextRepository->loadContext:91] | No SecurityContext was available from the HttpSession: null. A new one will be created.
[DEBUG] [2015-09-04 10:40:47,084] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.w.h.w.HstsHeaderWriter->writeHeaders:129] | Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@335af467
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 4 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.w.u.m.AntPathRequestMatcher->matches:145] | Checking match of request : '/home'; against '/logout'
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 5 of 11 in additional filter chain; firing Filter: 'CasAuthenticationFilter'
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.c.w.CasAuthenticationFilter->serviceTicketRequest:341] | serviceTicketRequest = false
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorConfigured:399] | proxyReceptorConfigured = false
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorRequest:384] | proxyReceptorRequest = false
[DEBUG] [2015-09-04 10:40:47,085] [] [o.s.s.c.w.CasAuthenticationFilter->proxyTicketRequest:359] | proxyTicketRequest = false
[DEBUG] [2015-09-04 10:40:47,086] [] [o.s.s.c.w.CasAuthenticationFilter->requiresAuthentication:290] | requiresAuthentication = false
[DEBUG] [2015-09-04 10:40:47,086] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
[DEBUG] [2015-09-04 10:40:47,086] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
[DEBUG] [2015-09-04 10:40:47,087] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
[DEBUG] [2015-09-04 10:40:47,089] [] [o.s.s.w.a.AnonymousAuthenticationFilter->doFilter:102] | Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
[DEBUG] [2015-09-04 10:40:47,089] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
[DEBUG] [2015-09-04 10:40:47,089] [] [o.s.s.w.s.SessionManagementFilter->doFilter:92] | Requested session ID JrbPx8JWxXJ7-NpmwEhxRojG.note-020 is invalid.
[DEBUG] [2015-09-04 10:40:47,089] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
[DEBUG] [2015-09-04 10:40:47,089] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /home at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
[DEBUG] [2015-09-04 10:40:47,090] [] [o.s.s.w.u.m.AntPathRequestMatcher->matches:145] | Checking match of request : '/home'; against '/home'
[DEBUG] [2015-09-04 10:40:47,090] [] [o.s.s.a.i.AbstractSecurityInterceptor->beforeInvocation:218] | Secure object: FilterInvocation: URL: /home; Attributes: [authenticated]
[DEBUG] [2015-09-04 10:40:47,091] [] [o.s.s.a.i.AbstractSecurityInterceptor->authenticateIfRequired:347] | Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS
[DEBUG] [2015-09-04 10:40:47,099] [] [o.s.s.a.v.AffirmativeBased->decide:65] | Voter: org.springframework.security.web.access.expression.WebExpressionVoter@5a9298b2, returned: -1
[TRACE] [2015-09-04 10:40:47,103] [] [o.s.c.s.AbstractApplicationContext->publishEvent:329] | Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@394bc20: org.springframework.security.access.event.AuthorizationFailureEvent[source=FilterInvocation: URL: /home]
[DEBUG] [2015-09-04 10:40:47,103] [] [o.s.b.f.s.AbstractBeanFactory->doGetBean:248] | Returning cached instance of singleton bean 'delegatingApplicationListener'
[DEBUG] [2015-09-04 10:40:47,104] [] [o.s.s.w.a.ExceptionTranslationFilter->handleSpringSecurityException:165] | Access is denied (user is anonymous); redirecting to authentication entry point
org.springframework.security.access.AccessDeniedException: Acesso negado
at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:83) ~[spring-security-core-4.0.2.RELEASE.jar:4.0.2.RELEASE]
... lots of stack ...
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]
然后我被重定向到CAS登录,在我发回日志后显示:
==> log/spring.log <==
[DEBUG] [2015-09-04 10:43:45,974] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
[DEBUG] [2015-09-04 10:43:45,974] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.c.HttpSessionSecurityContextRepository->readSecurityContextFromSession:152] | HttpSession returned null object for SPRING_SECURITY_CONTEXT
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.c.HttpSessionSecurityContextRepository->loadContext:91] | No SecurityContext was available from the HttpSession: org.eclipse.jetty.server.session.HashedSession:lx934b5jvixoittaje24iulh@495908524. A new one will be created.
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.h.w.HstsHeaderWriter->writeHeaders:129] | Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@335af467
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 4 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.u.m.AntPathRequestMatcher->matches:145] | Checking match of request : '/cas/j_spring_cas_security_check'; against '/logout'
[DEBUG] [2015-09-04 10:43:45,975] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 5 of 11 in additional filter chain; firing Filter: 'CasAuthenticationFilter'
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.c.w.CasAuthenticationFilter->serviceTicketRequest:341] | serviceTicketRequest = false
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorConfigured:399] | proxyReceptorConfigured = false
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorRequest:384] | proxyReceptorRequest = false
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.c.w.CasAuthenticationFilter->proxyTicketRequest:359] | proxyTicketRequest = false
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.c.w.CasAuthenticationFilter->requiresAuthentication:290] | requiresAuthentication = false
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.w.s.DefaultSavedRequest->propertyEquals:309] | pathInfo: both null (property equals)
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.w.s.DefaultSavedRequest->propertyEquals:317] | queryString: arg1=null; arg2=ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com (property not equals)
[DEBUG] [2015-09-04 10:43:45,976] [] [o.s.s.w.s.HttpSessionRequestCache->getMatchingRequest:75] | saved request doesn't match
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.a.AnonymousAuthenticationFilter->doFilter:102] | Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@90545b24: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@12afc: RemoteIpAddress: 127.0.0.1; SessionId: lx934b5jvixoittaje24iulh; Granted Authorities: ROLE_ANONYMOUS'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:337] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.w.u.m.AntPathRequestMatcher->matches:145] | Checking match of request : '/cas/j_spring_cas_security_check'; against '/home'
[DEBUG] [2015-09-04 10:43:45,977] [] [o.s.s.a.i.AbstractSecurityInterceptor->beforeInvocation:209] | Public object - authentication not attempted
[TRACE] [2015-09-04 10:43:45,978] [] [o.s.c.s.AbstractApplicationContext->publishEvent:329] | Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@394bc20: org.springframework.security.access.event.PublicInvocationEvent[source=FilterInvocation: URL: /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com]
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.b.f.s.AbstractBeanFactory->doGetBean:248] | Returning cached instance of singleton bean 'delegatingApplicationListener'
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.s.w.FilterChainProxy$VirtualFilterChain->doFilter:323] | /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com reached end of additional filter chain; proceeding with original chain
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.s.c.w.CasAuthenticationFilter->serviceTicketRequest:341] | serviceTicketRequest = false
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorConfigured:399] | proxyReceptorConfigured = false
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.s.c.w.CasAuthenticationFilter->proxyReceptorRequest:384] | proxyReceptorRequest = false
[DEBUG] [2015-09-04 10:43:45,978] [] [o.s.s.c.w.CasAuthenticationFilter->proxyTicketRequest:359] | proxyTicketRequest = false
[DEBUG] [2015-09-04 10:43:45,979] [] [o.s.s.c.w.CasAuthenticationFilter->requiresAuthentication:290] | requiresAuthentication = false
[TRACE] [2015-09-04 10:43:45,984] [] [o.s.w.s.FrameworkServlet->initContextHolders:1049] | Bound request context to thread: SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper@138d79b0]
[DEBUG] [2015-09-04 10:43:45,984] [] [o.s.w.s.DispatcherServlet->doService:861] | DispatcherServlet with name 'dispatcherServlet' processing GET request for [/cas/j_spring_cas_security_check]
[TRACE] [2015-09-04 10:43:45,985] [] [o.s.w.s.DispatcherServlet->getHandler:1117] | Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@e1d777] in DispatcherServlet with name 'dispatcherServlet'
[TRACE] [2015-09-04 10:43:45,988] [] [o.s.w.s.h.AbstractUrlHandlerMapping->getHandlerInternal:126] | No handler mapping found for [/cas/j_spring_cas_security_check]
[TRACE] [2015-09-04 10:43:45,989] [] [o.s.w.s.DispatcherServlet->getHandler:1117] | Testing handler map [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@1e2c4be5] in DispatcherServlet with name 'dispatcherServlet'
[DEBUG] [2015-09-04 10:43:45,989] [] [o.s.w.s.h.AbstractHandlerMethodMapping->getHandlerInternal:294] | Looking up handler method for path /cas/j_spring_cas_security_check
[DEBUG] [2015-09-04 10:43:45,994] [] [o.s.w.s.h.AbstractHandlerMethodMapping->getHandlerInternal:302] | Did not find handler method for [/cas/j_spring_cas_security_check]
[TRACE] [2015-09-04 10:43:45,994] [] [o.s.w.s.DispatcherServlet->getHandler:1117] | Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@73f998ad] in DispatcherServlet with name 'dispatcherServlet'
[TRACE] [2015-09-04 10:43:45,994] [] [o.s.w.s.h.AbstractUrlHandlerMapping->getHandlerInternal:126] | No handler mapping found for [/cas/j_spring_cas_security_check]
[TRACE] [2015-09-04 10:43:45,995] [] [o.s.w.s.DispatcherServlet->getHandler:1117] | Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@2354dcae] in DispatcherServlet with name 'dispatcherServlet'
[DEBUG] [2015-09-04 10:43:45,995] [] [o.s.w.s.h.AbstractUrlHandlerMapping->lookupHandler:168] | Matching patterns for request [/cas/j_spring_cas_security_check] are [/**]
[DEBUG] [2015-09-04 10:43:45,997] [] [o.s.w.s.h.AbstractUrlHandlerMapping->lookupHandler:193] | URI Template variables for request [/cas/j_spring_cas_security_check] are {}
[DEBUG] [2015-09-04 10:43:45,999] [] [o.s.w.s.h.AbstractUrlHandlerMapping->getHandlerInternal:123] | Mapping [/cas/j_spring_cas_security_check] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@3a8581bc]]] and 1 interceptor
[TRACE] [2015-09-04 10:43:46,000] [] [o.s.w.s.DispatcherServlet->getHandlerAdapter:1157] | Testing handler adapter [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter@6c27a2d3]
[TRACE] [2015-09-04 10:43:46,001] [] [o.s.w.s.DispatcherServlet->getHandlerAdapter:1157] | Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@1e8e8287]
[DEBUG] [2015-09-04 10:43:46,002] [] [o.s.w.s.DispatcherServlet->doDispatch:947] | Last-Modified value for [/cas/j_spring_cas_security_check] is: -1
[TRACE] [2015-09-04 10:43:46,003] [] [o.s.w.s.r.ResourceHttpRequestHandler->isInvalidPath:327] | Applying "invalid path" checks to path: cas/j_spring_cas_security_check
[TRACE] [2015-09-04 10:43:46,004] [] [o.s.w.s.r.AbstractResourceResolver->resolveResource:44] | Resolving resource: requestPath="cas/j_spring_cas_security_check"
[TRACE] [2015-09-04 10:43:46,005] [] [o.s.w.s.r.PathResourceResolver->getResource:92] | Checking location: ServletContext resource [/]
[TRACE] [2015-09-04 10:43:46,005] [] [o.s.w.s.r.PathResourceResolver->getResource:102] | No match for location: ServletContext resource [/]
[TRACE] [2015-09-04 10:43:46,006] [] [o.s.w.s.r.PathResourceResolver->getResource:92] | Checking location: class path resource [META-INF/resources/]
[TRACE] [2015-09-04 10:43:46,006] [] [o.s.w.s.r.PathResourceResolver->getResource:102] | No match for location: class path resource [META-INF/resources/]
[TRACE] [2015-09-04 10:43:46,007] [] [o.s.w.s.r.PathResourceResolver->getResource:92] | Checking location: class path resource [resources/]
[TRACE] [2015-09-04 10:43:46,008] [] [o.s.w.s.r.PathResourceResolver->getResource:102] | No match for location: class path resource [resources/]
[TRACE] [2015-09-04 10:43:46,008] [] [o.s.w.s.r.PathResourceResolver->getResource:92] | Checking location: class path resource [static/]
[TRACE] [2015-09-04 10:43:46,009] [] [o.s.w.s.r.PathResourceResolver->getResource:102] | No match for location: class path resource [static/]
[TRACE] [2015-09-04 10:43:46,009] [] [o.s.w.s.r.PathResourceResolver->getResource:92] | Checking location: class path resource [public/]
[TRACE] [2015-09-04 10:43:46,009] [] [o.s.w.s.r.PathResourceResolver->getResource:102] | No match for location: class path resource [public/]
[TRACE] [2015-09-04 10:43:46,010] [] [o.s.w.s.r.ResourceHttpRequestHandler->handleRequest:212] | No matching resource found - returning 404
[DEBUG] [2015-09-04 10:43:46,010] [] [o.s.s.w.c.HttpSessionSecurityContextRepository$SaveToSessionResponseWrapper->saveContext:304] | SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
[TRACE] [2015-09-04 10:43:46,012] [] [o.s.w.s.FrameworkServlet->initContextHolders:1049] | Bound request context to thread: (GET /cas/j_spring_cas_security_check?ticket=ST-16635-afTz1gs3R5sv4eRjleKc-login.movile.com)@743898861 org.eclipse.jetty.server.Request@2c56feed
[DEBUG] [2015-09-04 10:43:46,013] [] [o.s.w.s.DispatcherServlet->doService:861] | DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]
[TRACE] [2015-09-04 10:43:46,013] [] [o.s.w.s.DispatcherServlet->getHandler:1117] | Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@e1d777] in DispatcherServlet with name 'dispatcherServlet'
[TRACE] [2015-09-04 10:43:46,013] [] [o.s.w.s.h.AbstractUrlHandlerMapping->getHandlerInternal:126] | No handler mapping found for [/error]
任何人都可以发现缺少的东西吗?
提前感谢:)
答案 0 :(得分:1)
Spring Security 4更新了这个以及其他几个路径和属性(坦率地说,更好)。见这里:
https://jira.spring.io/browse/SEC-2783
j_spring_cas_security_check - &gt;登录/ CAS
正如用户在评论中指出的那样,您只需更新服务URL。