Skip to content

Commit

Permalink
I18N-1308: Header Authentication: Users cannot be services (#227)
Browse files Browse the repository at this point in the history
During service-service authentication, both the user and
service headers are sent. For the user flow, accounts are
created however if these are actually services we do not
want to create accounts on the fly. So validate that a user
is not a service before creating their accounts
  • Loading branch information
byronantak authored Jan 23, 2025
1 parent 37b5f1f commit d518ccd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public HeaderPreAuthFilter(HeaderSecurityConfig headerSecurityConfig) {
@Override
protected Object getPreAuthenticatedPrincipal(HttpServletRequest request) {
String forwardedUser = request.getHeader(headerSecurityConfig.userIdentifyingHeader);
if (forwardedUser != null) {
if (forwardedUser != null && !forwardedUser.contains(headerSecurityConfig.servicePrefix)) {
logger.debug("Forwarded user: {}", forwardedUser);
if (!forwardedUser.isEmpty()) {
return forwardedUser;
Expand Down

0 comments on commit d518ccd

Please sign in to comment.