報錯信息
<MethodNotAllowed>
<error>method_not_allowed</error>
<error_description>Request method 'GET' not supported</error_description>
</MethodNotAllowed>
39是單引號
原因
默認只支持post
解決方法
-
下載安裝postman工具(或其他post工具)
使用post調用
-
代碼增加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);
}
...
}