Skip to content

Commit

Permalink
Add username from request validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyamSanthosh committed Jan 18, 2024
1 parent 4e8ae6f commit 89c1249
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletRe
LogoutFailedException {

this.authenticationContext = context;
if (!isIdfInitiatedFromMagicLink()) {
if (!isIdfInitiatedFromMagicLink() || !isUsernameAvailableInRequest(request)) {
return super.process(request, response, authenticationContext);
}
if (context.isLogoutRequest()) {
Expand Down Expand Up @@ -517,6 +517,11 @@ private String validateIdentifierFromRequest(HttpServletRequest request, Authent
return identifierFromRequest;
}

private boolean isUsernameAvailableInRequest(HttpServletRequest request) {

return StringUtils.isNotBlank(request.getParameter(USER_NAME));
}

/**
* This method is used to resolve the user from authentication response from identifier handler.
*
Expand Down

0 comments on commit 89c1249

Please sign in to comment.