Tag Archives: method_not_allowed(Request method ‘GET’ not supported)

[Solved] oauth2(spring security) Error: method_not_allowed(Request method ‘GET’ not supported)

Error message

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

39 is a single quotation mark

reason

Only post is supported by default

Solution:

Download and install the postman tool (or other post tools)
use post to call

Code add get method

@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);
    }
...
}

 

[Solved] Oauth2(spring security)method_not_allowed(Request method ‘GET’ not supported)

 

Error information

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

39 is a single quotation mark

Why

Only post is supported by default

Solutions

download and install postman tool (or other post tools) and use post to call

method of adding get to code

@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);
    }
...