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:
Jean-Pierre Bergamin 2020-05-06 18:25:43 +02:00 committed by Eleftheria Stein-Kousathana
parent e1fd0b3859
commit 6d5d883518
1 changed files with 2 additions and 2 deletions

View File

@ -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();