Use Opaquetoken properties to configure timeouts
Improve the documentation to show how to re-use the Opaquetoken properties of `OAuth2ResourceServerProperties` to set up basic auth in the configured `RestTemplate`.
This commit is contained in:
parent
e1fd0b3859
commit
6d5d883518
|
@ -1573,9 +1573,9 @@ To adjust the way in which Resource Server connects to the authorization server,
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@Bean
|
@Bean
|
||||||
public OpaqueTokenIntrospector introspector(RestTemplateBuilder builder) {
|
public OpaqueTokenIntrospector introspector(RestTemplateBuilder builder, OAuth2ResourceServerProperties properties) {
|
||||||
RestOperations rest = builder
|
RestOperations rest = builder
|
||||||
.basicAuthentication(clientId, clientSecret)
|
.basicAuthentication(properties.getOpaquetoken().getClientId(), properties.getOpaquetoken().getClientSecret())
|
||||||
.setConnectionTimeout(60000)
|
.setConnectionTimeout(60000)
|
||||||
.setReadTimeout(60000)
|
.setReadTimeout(60000)
|
||||||
.build();
|
.build();
|
||||||
|
|
Loading…
Reference in New Issue