From cfdafd67233ddcd0b2c6347001ac5ddf24e35492 Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Wed, 14 Aug 2024 12:07:57 -0400 Subject: [PATCH] Enhance login logging in RASAuthenticationService Updated the logging messages to include additional context by incorporating the authorization code and user subject. These changes were made to allow for chaining logs in splunk. --- .../impl/authentication/RASAuthenticationService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/authentication/RASAuthenticationService.java b/pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/authentication/RASAuthenticationService.java index 97403543..be96d043 100644 --- a/pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/authentication/RASAuthenticationService.java +++ b/pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/impl/authentication/RASAuthenticationService.java @@ -94,13 +94,13 @@ public HashMap authenticate(Map authRequest, Str } if (introspectResponse == null) { - logger.info("LOGIN FAILED ___ USER NOT AUTHENTICATED ___ INTROSPECTION RESPONSE {}", introspectResponse); + logger.info("LOGIN FAILED ___ USER NOT AUTHENTICATED ___ INTROSPECTION RESPONSE {} ___ CODE {}", introspectResponse, authRequest.get("code")); return null; } Optional initializedUser = initializeUser(introspectResponse); if (initializedUser.isEmpty()) { - logger.info("LOGIN FAILED ___ COULD NOT CREATE USER "); + logger.info("LOGIN FAILED ___ COULD NOT CREATE USER ___ INTROSPECTION RESPONSE {} ___ CODE {}", introspectResponse, authRequest.get("code")); return null; } @@ -137,7 +137,7 @@ public HashMap authenticate(Map authRequest, Str userService.save(user); HashMap responseMap = createUserClaims(user, idToken); responseMap.put("oktaIdToken", idToken); - logger.info("LOGIN SUCCESS ___ {}:{} ___ Authorization will expire at ___ {}___", user.getEmail(), user.getUuid().toString(), responseMap.get("expirationDate")); + logger.info("LOGIN SUCCESS ___ USER {}:{} ___ AUTHORIZATION WILL EXPIRE AT ___ {}___", user.getSubject(), user.getUuid().toString(), responseMap.get("expirationDate")); return responseMap; }