Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
spring Webflux中带有WebClient的OAuth 2.0身份验证标头_Spring_Spring Boot_Spring Security_Spring Webflux_Spring Webclient - Fatal编程技术网

spring Webflux中带有WebClient的OAuth 2.0身份验证标头

spring Webflux中带有WebClient的OAuth 2.0身份验证标头,spring,spring-boot,spring-security,spring-webflux,spring-webclient,Spring,Spring Boot,Spring Security,Spring Webflux,Spring Webclient,我想创建一个WebClient请求,它相当于以下内容 curl -X POST "http://localhost:8082/oauth/token" --user clientapp:123456 -d "grant_type=client_credentials&scope=admin" 经过研究我发现 private WebClient client = WebClient.builder() .defaultHea

我想创建一个WebClient请求,它相当于以下内容

curl -X POST "http://localhost:8082/oauth/token" --user clientapp:123456 -d "grant_type=client_credentials&scope=admin"
经过研究我发现

private WebClient client = WebClient.builder()
            .defaultHeaders(header -> header.setBasicAuth(userName, password))
            .build();
但是我找不到添加
grant\u类型
范围
的方法。我该怎么做?提前感谢

可能重复