Skip to content

Commit

Permalink
identity recovery: rewrite the list of candidates after each correlat…
Browse files Browse the repository at this point in the history
…ion step;

auth exception in case of zero candidates (should be reworked)
  • Loading branch information
KaterynaHonchar committed Oct 11, 2023
1 parent 0c68172 commit 829e40e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public boolean isEmptyCorrelatorsList() {
return CollectionUtils.isEmpty(correlators);
}

public void addCandidateOwners(CandidateOwnersMap map) {
public void rewriteCandidateOwners(CandidateOwnersMap map) {
candidateOwners.clear();
candidateOwners.mergeWith(map);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public Authentication doAuthenticate(
focusType);
ObjectType owner = correlationResult.getOwner();

if (owner == null && !candidateOwnerExist(correlationResult)) {
throw new AuthenticationServiceException("No identity is found.");
}

correlationModuleAuthentication.addAttributes(correlationVerificationToken.getDetails());

correlationModuleAuthentication.setPreFocus(correlationVerificationToken.getPreFocus(focusType,
Expand All @@ -93,7 +97,7 @@ public Authentication doAuthenticate(
}

CandidateOwnersMap ownersMap = correlationResult.getCandidateOwnersMap();
correlationModuleAuthentication.addCandidateOwners(ownersMap);
correlationModuleAuthentication.rewriteCandidateOwners(ownersMap);

return authentication;
} catch (Exception e) {
Expand Down

0 comments on commit 829e40e

Please sign in to comment.