ClientRegistrations#rest defines 30s connect and read timeouts
This commit is contained in:
parent
70eea8dc67
commit
bea7761a1c
|
@ -30,6 +30,7 @@ import net.minidev.json.JSONObject;
|
||||||
|
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||||
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
|
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
|
||||||
import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames;
|
import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames;
|
||||||
|
@ -58,6 +59,13 @@ public final class ClientRegistrations {
|
||||||
|
|
||||||
private static final RestTemplate rest = new RestTemplate();
|
private static final RestTemplate rest = new RestTemplate();
|
||||||
|
|
||||||
|
static {
|
||||||
|
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
|
||||||
|
requestFactory.setConnectTimeout(30_000);
|
||||||
|
requestFactory.setReadTimeout(30_000);
|
||||||
|
rest.setRequestFactory(requestFactory);
|
||||||
|
}
|
||||||
|
|
||||||
private static final ParameterizedTypeReference<Map<String, Object>> typeReference = new ParameterizedTypeReference<Map<String, Object>>() {
|
private static final ParameterizedTypeReference<Map<String, Object>> typeReference = new ParameterizedTypeReference<Map<String, Object>>() {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue