Skip to content

Commit

Permalink
fixing user redirection after user is locked
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 9, 2023
1 parent 98e8bbb commit c47b99e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.evolveum.midpoint.authentication.api.AuthModule;
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor;
import com.evolveum.midpoint.authentication.api.config.ModuleAuthentication;
import com.evolveum.midpoint.gui.api.page.PageAdminLTE;
Expand Down Expand Up @@ -180,10 +179,10 @@ private void showExceptionMessage() {
}

private boolean showErrorMessage() {
return !previousPrecessedModuleHasSufficientNecessity();
return !previousPrecessedModuleHasRequisiteNecessity();
}

private boolean previousPrecessedModuleHasSufficientNecessity() {
private boolean previousPrecessedModuleHasRequisiteNecessity() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo
saveException(request, exception);
getRedirectStrategy().sendRedirect(request, response, mpAuthentication.getAuthenticationChannel().getPathDuringProccessing());
return;
} else {
moduleAuthentication.recordFailure(exception);
saveException(request, mpAuthentication.getAuthenticationExceptionIfExsits());
getRedirectStrategy().sendRedirect(request, response, mpAuthentication.getAuthenticationChannel().getPathAfterUnsuccessfulAuthentication());
}
moduleAuthentication.recordFailure(exception);
saveException(request, mpAuthentication.getAuthenticationExceptionIfExsits());
}

saveException(request, exception);
Expand Down

0 comments on commit c47b99e

Please sign in to comment.