当我尝试使用client_credentials身份验证时,我收到了这个奇怪的错误。 我说的很奇怪,因为POST是默认方法和身份验证通过,所以错误没有意义。
会对可能发生的事情有所了解!
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.provider.expression.OAuth2MethodSecurityExpressionHandler;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
@Configuration
public class OAuth2ServerConfig {
/**
* Setting web authentication for the resource server
*/
@Configuration
@EnableResourceServer
protected static class ResourceServerConfig extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated();
}
}
/**
* Enabling security by expressions
*/
@Configuration
@EnableResourceServer
@EnableGlobalMethodSecurity(prePostEnabled = true)
protected static class GlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration {
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
return new OAuth2MethodSecurityExpressionHandler();
}
}
/**
* Configuring the authorization server
*/
@Configuration
@EnableAuthorizationServer
public static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
public static final String CLIENT_ID = "...";
public static final String CLIENT_SECRET = "....";
private TokenStore tokenStore = new InMemoryTokenStore();
@Autowired
@Qualifier("authenticationManagerBean")
private AuthenticationManager authenticationManager;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.tokenStore(this.tokenStore).authenticationManager(this.authenticationManager);
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
.withClient(CLIENT_ID)
.secret(CLIENT_SECRET)
.authorizedGrantTypes("client_credentials")
.scopes("read", "write");
}
}
}
网络安全:
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication();
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers(PingController.ENDPOINT).permitAll()
.anyRequest().authenticated().and()
.httpBasic();
}
}
这是请求的日志(我认为这似乎很顺利):
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/css/**'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/js/**'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/images/**'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/**/favicon.ico'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/error'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='/oauth/token']
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/oauth/token'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.s.web.util.matcher.OrRequestMatcher : matched
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] 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@3af64cd3
2016-10-03 08:02:58.391 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 4 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
2016-10-03 08:02:58.392 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/logout'
2016-10-03 08:02:58.392 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
2016-10-03 08:02:58.393 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.www.BasicAuthenticationFilter : Basic Authentication Authorization header found for user 'frxiBDhlaDpxulFzm5dp7Ax0jt'
2016-10-03 08:02:58.394 DEBUG 48084 --- [io-8080-exec-11] o.s.s.authentication.ProviderManager : Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : Looking for Pre/Post annotations for method 'loadClientByClientId' on target class 'class org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService'
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : No expression annotations found
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : Looking for Pre/Post annotations for method 'setClientDetailsStore' on target class 'class org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService'
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : No expression annotations found
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : Looking for Pre/Post annotations for method 'loadClientByClientId' on target class 'class org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService'
2016-10-03 08:02:58.399 TRACE 48084 --- [io-8080-exec-11] .PrePostAnnotationSecurityMetadataSource : No expression annotations found
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.www.BasicAuthenticationFilter : Authentication success: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@820d5399: Principal: org.springframework.security.core.userdetails.User@7df21f39: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Not granted any authorities
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.AnonymousAuthenticationFilter : SecurityContextHolder not populated with anonymous token, as it already contained: 'org.springframework.security.authentication.UsernamePasswordAuthenticationToken@820d5399: Principal: org.springframework.security.core.userdetails.User@7df21f39: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Not granted any authorities'
2016-10-03 08:02:58.402 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] s.CompositeSessionAuthenticationStrategy : Delegating to org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy@e037fe8
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/oauth/token'
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.i.FilterSecurityInterceptor : Secure object: FilterInvocation: URL: /oauth/token; Attributes: [fullyAuthenticated]
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.i.FilterSecurityInterceptor : Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@820d5399: Principal: org.springframework.security.core.userdetails.User@7df21f39: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Not granted any authorities
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.access.vote.AffirmativeBased : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@697acb2a, returned: 1
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.i.FilterSecurityInterceptor : Authorization successful
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.i.FilterSecurityInterceptor : RunAsManager did not change Authentication object
2016-10-03 08:02:58.403 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /oauth/token reached end of additional filter chain; proceeding with original chain
2016-10-03 08:02:58.405 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Bound request context to thread: SecurityContextHolderAwareRequestWrapper[ FirewalledRequest[ org.apache.catalina.connector.RequestFacade@e7e2eeb]]
2016-10-03 08:02:58.405 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing POST request for [/gynto-api-1.0/oauth/token]
2016-10-03 08:02:58.405 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Testing handler map [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@27fb8477] in DispatcherServlet with name 'dispatcherServlet'
2016-10-03 08:02:58.406 DEBUG 48084 --- [io-8080-exec-11] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /oauth/token
2016-10-03 08:02:58.412 DEBUG 48084 --- [io-8080-exec-11] .m.m.a.ExceptionHandlerExceptionResolver : Resolving exception from handler [null]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
2016-10-03 08:02:58.412 DEBUG 48084 --- [io-8080-exec-11] .w.s.m.a.ResponseStatusExceptionResolver : Resolving exception from handler [null]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
2016-10-03 08:02:58.412 DEBUG 48084 --- [io-8080-exec-11] .w.s.m.s.DefaultHandlerExceptionResolver : Resolving exception from handler [null]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
2016-10-03 08:02:58.413 WARN 48084 --- [io-8080-exec-11] o.s.web.servlet.PageNotFound : Request method 'POST' not supported
2016-10-03 08:02:58.413 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2016-10-03 08:02:58.413 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Cleared thread-bound request context: SecurityContextHolderAwareRequestWrapper[ FirewalledRequest[ org.apache.catalina.connector.RequestFacade@e7e2eeb]]
2016-10-03 08:02:58.413 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Successfully completed request
2016-10-03 08:02:58.414 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally
2016-10-03 08:02:58.414 DEBUG 48084 --- [io-8080-exec-11] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '/css/**'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '/js/**'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '/images/**'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '/**/favicon.ico'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '/error'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.security.web.FilterChainProxy : /error has an empty filter list
2016-10-03 08:02:58.416 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Bound request context to thread: FirewalledRequest[ org.apache.catalina.core.ApplicationHttpRequest@ada3202]
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing POST request for [/gynto-api-1.0/error]
2016-10-03 08:02:58.416 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Testing handler map [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@27fb8477] in DispatcherServlet with name 'dispatcherServlet'
2016-10-03 08:02:58.416 DEBUG 48084 --- [io-8080-exec-11] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /error
2016-10-03 08:02:58.418 TRACE 48084 --- [io-8080-exec-11] s.w.s.m.m.a.RequestMappingHandlerMapping : Found 2 matching mapping(s) for [/error] : [{[/error]}, {[/error],produces=[text/html]}]
2016-10-03 08:02:58.418 DEBUG 48084 --- [io-8080-exec-11] s.w.s.m.m.a.RequestMappingHandlerMapping : Returning handler method [public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)]
2016-10-03 08:02:58.419 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Testing handler adapter [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter@56bcbf0a]
2016-10-03 08:02:58.422 DEBUG 48084 --- [io-8080-exec-11] o.s.web.cors.DefaultCorsProcessor : Skip CORS processing: response already contains "Access-Control-Allow-Origin" header
2016-10-03 08:02:58.432 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.method.annotation.RequestParamMethodArgumentResolver@57fd3677] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.433 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.method.annotation.RequestParamMapMethodArgumentResolver@6ec69ff3] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.433 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.PathVariableMethodArgumentResolver@773d7e4] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.433 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.PathVariableMapMethodArgumentResolver@541b02b6] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.433 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMethodArgumentResolver@4dce3326] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.433 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver@a836d1d] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor@36e83868] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor@2b62f056] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver@4543cc5d] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.method.annotation.RequestHeaderMethodArgumentResolver@799f74e3] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.method.annotation.RequestHeaderMapMethodArgumentResolver@608a10d4] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver@62b0584a] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver@51948439] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.434 TRACE 48084 --- [io-8080-exec-11] s.HandlerMethodArgumentResolverComposite : Testing if argument resolver [org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver@3186e449] supports [interface javax.servlet.http.HttpServletRequest]
2016-10-03 08:02:58.435 TRACE 48084 --- [io-8080-exec-11] .w.s.m.m.a.ServletInvocableHandlerMethod : Invoking [BasicErrorController.error] method with arguments [FirewalledRequest[ org.apache.catalina.core.ApplicationHttpRequest@ada3202]]
2016-10-03 08:02:58.435 TRACE 48084 --- [io-8080-exec-11] .w.s.m.m.a.ServletInvocableHandlerMethod : Method [error] returned [<405 Method Not Allowed,{timestamp=Mon Oct 03 08:02:58 UYT 2016, status=405, error=Method Not Allowed, exception=org.springframework.web.HttpRequestMethodNotSupportedException, message=Request method 'POST' not supported, path=/gynto-api-1.0/oauth/token},{}>]
2016-10-03 08:02:58.450 DEBUG 48084 --- [io-8080-exec-11] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Written [{timestamp=Mon Oct 03 08:02:58 UYT 2016, status=405, error=Method Not Allowed, exception=org.springframework.web.HttpRequestMethodNotSupportedException, message=Request method 'POST' not supported, path=/gynto-api-1.0/oauth/token}] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@6d3b37cf]
2016-10-03 08:02:58.450 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2016-10-03 08:02:58.450 TRACE 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Cleared thread-bound request context: FirewalledRequest[ org.apache.catalina.core.ApplicationHttpRequest@ada3202]
2016-10-03 08:02:58.450 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet : Successfully completed request
答案 0 :(得分:1)