OAUTH2支持GET请求

来源:互联网 发布:python语言及其应用 编辑:程序博客网 时间:2024/06/16 13:30
package com.fushihua.oauth2.config;import java.util.Arrays;import java.util.HashSet;import java.util.Set;import javax.annotation.PostConstruct;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.context.annotation.Configuration;import org.springframework.http.HttpMethod;import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint;/** * @ClassName: AllowedMethodConfig  * @Description: OAUTH2支持GET请求 * @author fushihua * @date 2017年11月13日 下午3:03:07 */@Configurationpublic class AllowedMethodConfig {    @Autowired    private TokenEndpoint tokenEndpoint;    @PostConstruct    public void reconfigure() {        Set<HttpMethod> allowedMethods =            new HashSet<>(Arrays.asList(HttpMethod.GET, HttpMethod.POST));        tokenEndpoint.setAllowedRequestMethods(allowedMethods);    }}


原创粉丝点击