diff --git a/src/main/java/io/phasetwo/service/auth/idp/HomeIdpDiscoveryAuthenticator.java b/src/main/java/io/phasetwo/service/auth/idp/HomeIdpDiscoveryAuthenticator.java index c932fc27..d8423e13 100755 --- a/src/main/java/io/phasetwo/service/auth/idp/HomeIdpDiscoveryAuthenticator.java +++ b/src/main/java/io/phasetwo/service/auth/idp/HomeIdpDiscoveryAuthenticator.java @@ -127,6 +127,14 @@ private String setUserInContext(AuthenticationFlowContext context, String userna context.clearUser(); username = trimToNull(username); + /*Todo: @xpg. I saw this piece of code in a PR you've made. I'm not sure it's needed since on line 53 we get the attemptedUsername using the usernameHint method. Please check + if (username == null) { + LOG.debug( + "Could not find username in request. Trying attempted username from previous authenticator"); + username = getAttemptedUsername(context); + } + */ + if (username == null) { LOG.warn("No or empty username found in request"); context.getEvent().error(Errors.USER_NOT_FOUND);