Skip to content

Commit

Permalink
change delimeter for username/domain concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoberle committed Jan 14, 2018
1 parent 9fe3d27 commit f0175dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ private UsernamePasswordAuthenticationToken getAuthRequest(HttpServletRequest re
domain = "";
}

username = username.trim();
return new UsernamePasswordAuthenticationToken(username + ":" + domain, password);
String usernameDomain = String.format("%s%s%s", username.trim(),
String.valueOf(Character.LINE_SEPARATOR), domain);
return new UsernamePasswordAuthenticationToken(usernameDomain, password);
}

private String obtainDomain(HttpServletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public CustomUserDetailsService(UserRepository userRepository) {

@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
String[] usernameAndDomain = StringUtils.split(username, ":");
String[] usernameAndDomain = StringUtils.split(username, String.valueOf(Character.LINE_SEPARATOR));
if (usernameAndDomain == null || usernameAndDomain.length != 2) {
throw new UsernameNotFoundException("Username and domain must be provided");
}
Expand Down

0 comments on commit f0175dd

Please sign in to comment.