<MethodNotAllowed>
<error>method_not_allowed</error>
<error_description>Request method &#39;GET&#39; not supported</error_description>
</MethodNotAllowed>

39是单引号

原因

默认只支持post

解决方法

  1. 下载安装postman工具(或其他post工具)
    使用post调用
    oauth2(spring security)报错method_not_allowed(Request method 'GET' not supported)解决方法

  2. 代码增加get的方法

@Configuration
public class OAuthSecurityConfig extends AuthorizationServerConfigurerAdapter {
...
    @Override
    public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
        ...
        endpoints.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST);// add get method
        ...

        endpoints.tokenServices(tokenServices);
    }
...
}

参考资料

stackoverflow
csdn blog

相关文章:

  • 2021-07-27
  • 2021-11-30
  • 2021-08-02
  • 2021-12-09
  • 2021-08-19
  • 2021-08-26
猜你喜欢
  • 2021-07-24
  • 2021-08-21
  • 2022-12-23
  • 2021-10-03
  • 2021-09-28
相关资源
相似解决方案