2016-10-03 8 views
1

client_credentials認証を使用しようとすると、この奇妙なエラーが発生します。 私はPOSTがデフォルトの方法で認証パスが奇妙なので、エラーには意味がありません。405/oauth /トークンエンドポイントでメソッドが許可されない

何が起こっているのでしょうか?

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"); 
     } 

    } 

} 

およびWebセキュリティ:ここで

@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.se[email protected]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.springframew[email protected]820d5399: Principal: [email protected]: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]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.springframew[email protected]820d5399: Principal: [email protected]: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]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.w[email protected]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.springframew[email protected]820d5399: Principal: [email protected]: Username: frxiBDhlaDpxulFzm5dp7Ax0jt; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]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.sp[email protected]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[ [email protected]]] 
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[email protected]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[ [email protected]]] 
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[ [email protected]] 
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[email protected]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[email protected]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.springfra[email protected]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.springframew[email protected]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.s[email protected]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.serv[email protected]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.ser[email protected]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.servle[email protected]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.ser[email protected]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.s[email protected]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.[email protected]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.springfram[email protected]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.springframewo[email protected]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[email protected]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.springframew[email protected]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.S[email protected]9] 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[ [email protected]]] 
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.springfr[email protected]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[ [email protected]] 
2016-10-03 08:02:58.450 DEBUG 48084 --- [io-8080-exec-11] o.s.web.servlet.DispatcherServlet  : Successfully completed request 

答えて

1

OMGみんな、私は別のコントローラを持っていました誤ってエンドポイントをマッピングします。 これが問題でした。それは恥ずかしいです:)

+0

こんにちは、あなたがここでそれを解決し、それは私を狂っている解決、同じ問題に直面した、以下はエラーですか? [org.springframework.http.converter()を使用して "application/json"として書かれた[m ethodが許可されていない、例外= org.springframework.web.HttpRequestMethodNotSupportedException、message =リクエストメソッド 'POST'がサポートされていない、path =/oauth/token} .json.MappingJackson2HttpMessageConverter @ 69dc7b24] – Dan

関連する問題