Skip to content

Commit

Permalink
Merge pull request #27811 from sberyozkin/fix_oidc_supplier_null_error
Browse files Browse the repository at this point in the history
More fixes related to 'The supplier returned null' message
  • Loading branch information
sberyozkin authored Sep 8, 2022
2 parents 821f5eb + 9becad4 commit 00d756c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Uni<Tokens> get() {
.atMost(oidcConfig.connectionRetryCount)
.onFailure().transform(t -> {
LOG.warn("OIDC Server is not available:", t.getCause() != null ? t.getCause() : t);
// don't wrap t to avoid information leak
// don't wrap it to avoid information leak
return new OidcClientException("OIDC Server is not available");
});
return response.onItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ public static Uni<JsonObject> discoverMetadata(WebClient client, String authServ
.retry()
.withBackOff(CONNECTION_BACKOFF_DURATION, CONNECTION_BACKOFF_DURATION)
.expireIn(connectionDelayInMillisecs)
.onFailure().transform(t -> t.getCause());
.onFailure().transform(t -> {
LOG.warn("OIDC Server is not available:", t.getCause() != null ? t.getCause() : t);
// don't wrap it to avoid information leak
return new RuntimeException("OIDC Server is not available");
});
}

private static byte[] getFileContent(Path path) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ private void createRealm(String keycloakUrl, RealmRepresentation realm) {
.retry()
.withBackOff(Duration.ofSeconds(2), Duration.ofSeconds(2))
.expireIn(10 * 1000)
.onFailure().transform(t -> t.getCause());
.onFailure().transform(t -> {
return new RuntimeException("Keycloak server is not available"
+ (t.getMessage() != null ? (": " + t.getMessage()) : ""));
});
realmStatusCodeUni.await().atMost(Duration.ofSeconds(10));
} catch (Throwable t) {
LOG.errorf("Realm %s can not be created: %s", realm.getRealm(), t.getMessage());
Expand Down

0 comments on commit 00d756c

Please sign in to comment.