Skip to content

Commit

Permalink
Enhance login logging in RASAuthenticationService
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gcolon021 committed Aug 14, 2024
1 parent f93acb2 commit cfdafd6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ public HashMap<String, String> authenticate(Map<String, String> 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<User> 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;
}

Expand Down Expand Up @@ -137,7 +137,7 @@ public HashMap<String, String> authenticate(Map<String, String> authRequest, Str
userService.save(user);
HashMap<String, String> 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;
}

Expand Down

0 comments on commit cfdafd6

Please # to comment.