Skip to content

Commit

Permalink
MID-9178: fix for finish of authentication sequence when use more suf…
Browse files Browse the repository at this point in the history
…ficient modules and first is successfull
  • Loading branch information
skublik committed Oct 5, 2023
1 parent 582d946 commit 1153b1c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,36 @@ private boolean allModulesAreAuthenticated() {
public boolean isFinished() {
int actualSize = getAuthentications().size();
int endSize = getAuthModules().size();
return processingModuleIsRequisiteAndFailure() || (actualSize == endSize && allModulesAreProcessed());
return successfulProcessedSufficientModule() || processingModuleIsRequisiteAndFailure() || (actualSize == endSize && allModulesAreProcessed());
}

private boolean successfulProcessedSufficientModule() {
boolean successOneSufficientModule = false;

for (AuthenticationSequenceModuleType module : getSequence().getModule()) {
if (AuthenticationSequenceModuleNecessityType.REQUISITE == module.getNecessity()
|| AuthenticationSequenceModuleNecessityType.OPTIONAL == module.getNecessity()) {
continue;
}
if (AuthenticationSequenceModuleNecessityType.REQUIRED == module.getNecessity()) {
ModuleAuthentication authentication = getAuthenticationByIdentifier(module);
if (authentication == null
|| AuthenticationModuleState.SUCCESSFULLY != authentication.getState()) {
return false;
}
}
if (AuthenticationSequenceModuleNecessityType.SUFFICIENT == module.getNecessity()) {
ModuleAuthentication authentication = getAuthenticationByIdentifier(module);
if (authentication == null) {
continue;
}
if (AuthenticationModuleState.SUCCESSFULLY == authentication.getState()) {
successOneSufficientModule = true;
}
}
}

return successOneSufficientModule;
}

private boolean processingModuleIsRequisiteAndFailure() {
Expand Down

This file was deleted.

0 comments on commit 1153b1c

Please sign in to comment.