Skip to content

Commit e5c5a0f

Browse files
committed
Log OIDC Client requests in debug mode
1 parent 78b3174 commit e5c5a0f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

extensions/oidc-client/runtime/src/main/java/io/quarkus/oidc/client/runtime/OidcClientImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ private UniOnItem<HttpResponse<Buffer>> postRequest(
240240
body.add(entry.getKey(), entry.getValue());
241241
}
242242
}
243+
if (LOG.isDebugEnabled()) {
244+
LOG.debugf("Token endpoint: %s, request params: %s, headers: %s", request.uri(), body, request.headers());
245+
}
243246
// Retry up to three times with a one-second delay between the retries if the connection is closed
244247
Buffer buffer = OidcCommonUtils.encodeForm(body);
245248
Uni<HttpResponse<Buffer>> response = filterHttpRequest(requestProps, endpointType, request, buffer)

extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcProviderClientImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,11 @@ private UniOnItem<HttpResponse<Buffer>> getHttpResponse(OidcRequestContextProper
338338
request.putHeader(headerEntry.getKey(), headerEntry.getValue());
339339
}
340340
}
341-
342-
LOG.debugf("%s token: %s params: %s headers: %s", (introspect ? "Introspect" : "Get"), metadata.getTokenUri(), formBody,
343-
request.headers());
341+
if (LOG.isDebugEnabled()) {
342+
LOG.debugf("%s token: %s params: %s headers: %s", (introspect ? "Introspect" : "Get"), metadata.getTokenUri(),
343+
formBody,
344+
request.headers());
345+
}
344346
// Retry up to three times with a one-second delay between the retries if the connection is closed.
345347

346348
OidcEndpoint.Type endpoint = introspect ? OidcEndpoint.Type.INTROSPECTION : OidcEndpoint.Type.TOKEN;

0 commit comments

Comments
 (0)