优化代码,去掉已过时代码

This commit is contained in:
janeluo 2024-03-17 21:01:25 +08:00
parent cfe913abdb
commit 6e40596088

View File

@ -17,6 +17,7 @@
package org.dromara.maxkey.authz.oauth2.provider.endpoint; package org.dromara.maxkey.authz.oauth2.provider.endpoint;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -231,7 +232,7 @@ public class TokenEndpointAuthenticationFilter implements Filter {
public Authentication ClientCredentials(HttpServletRequest request, HttpServletResponse response) public Authentication ClientCredentials(HttpServletRequest request, HttpServletResponse response)
throws AuthenticationException, IOException, ServletException { throws AuthenticationException, IOException, ServletException {
if (allowOnlyPost && !"POST".equalsIgnoreCase(request.getMethod())) { if (allowOnlyPost && !"POST".equalsIgnoreCase(request.getMethod())) {
throw new HttpRequestMethodNotSupportedException(request.getMethod(), new String[] { "POST","G" }); throw new HttpRequestMethodNotSupportedException(request.getMethod(), Arrays.asList("POST","G"));
} }
String clientId = request.getParameter(OAuth2Constants.PARAMETER.CLIENT_ID); String clientId = request.getParameter(OAuth2Constants.PARAMETER.CLIENT_ID);