AuthenticationService needs a new method with the declaration UserAccount GetLoggedInUser(HttpServletRequest request).
Implementation
[x] Create class method in AuthenticationService with the header UserAccount GetLoggedInUser(HttpServletRequest request).
[x] Have the method return the UserAccount entity associated with the username located in request.getRemoteUser().
[x] Write integration tests (not E2E or unit) that injects a user into the database, logs in through the REST controller, then verifies that this method returns the correct user (use @Profile("!prod") to block backdoor login in production).
Summary
AuthenticationService
needs a new method with the declarationUserAccount GetLoggedInUser(HttpServletRequest request)
.Implementation
AuthenticationService
with the headerUserAccount GetLoggedInUser(HttpServletRequest request)
.UserAccount
entity associated with the username located inrequest.getRemoteUser()
.@Profile("!prod")
to block backdoor login in production).