Skip to content

Commit

Permalink
Merge pull request #21986 from sberyozkin/oidc_jwkset_client_close
Browse files Browse the repository at this point in the history
OidcProviderClient has to be closed only when getting the JWK set failed
  • Loading branch information
FroMage authored Dec 7, 2021
2 parents 28207e2 + 3b1a635 commit 99ea971
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.oidc.client.runtime;

import java.io.IOException;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiFunction;
Expand Down Expand Up @@ -34,7 +33,6 @@ public class OidcClientRecorder {

private static final Logger LOG = Logger.getLogger(OidcClientRecorder.class);
private static final String DEFAULT_OIDC_CLIENT_ID = "Default";
private static final Duration CONNECTION_BACKOFF_DURATION = Duration.ofSeconds(2);

public OidcClients setup(OidcClientsConfig oidcClientsConfig, TlsConfig tlsConfig, Supplier<Vertx> vertx) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ protected static Uni<JsonWebKeySet> getJsonWebSetUni(OidcProviderClient client,
.expireIn(connectionDelayInMillisecs)
.onFailure()
.transform(t -> toOidcException(t, oidcConfig.authServerUrl.get()))
.onFailure()
.invoke(client::close);
} else {
return client.getJsonWebKeySet();
Expand Down

0 comments on commit 99ea971

Please sign in to comment.