Skip to content

Commit

Permalink
[cas-2393] Use sso email id to validate the user
Browse files Browse the repository at this point in the history
  • Loading branch information
smanga-11 committed May 23, 2024
1 parent aaede83 commit 4c1de29
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ private CaTMessageOCDSAllOfAuthor getAuthorDetails(
.resolveBuyerUserByUserId(String.valueOf(message.getSenderUser().getId()))
.orElseThrow(() -> new ResourceNotFoundException(
String.format("Jaggaer user not found for %s", message.getSenderUser().getId())));
var conclaveUser = conclaveService.getUserProfile(jaggaerUser.getEmail())

This comment has been minimized.

Copy link
@SamThomasJ

SamThomasJ May 23, 2024

Contributor

Is this used in other places in the app? I'll have a search

jaggaerUser.getEmail()

This comment has been minimized.

Copy link
@SamThomasJ

SamThomasJ May 23, 2024

Contributor

Screenshot 2024-05-23 at 14 47 10

Looks like this is the only place

.orElseThrow(() -> new ResourceNotFoundException("Conclave"));
Optional<SSOCodeData.SSOCode> ssoCode = jaggaerUser.getSsoCodeData().getSsoCode().stream().findFirst();
var conclaveUser = conclaveService.getUserProfile(ssoCode.isPresent()
&& Objects.nonNull(ssoCode.get().getSsoUserLogin())
? ssoCode.get().getSsoUserLogin() : jaggaerUser.getEmail())
.orElseThrow(() -> new ResourceNotFoundException("Conclave"));
var conclaveOrg = conclaveService.getOrganisationIdentity(conclaveUser.getOrganisationId())
.orElseThrow(() -> new ResourceNotFoundException(
format(ERR_MSG_FMT_CONCLAVE_USER_ORG_MISSING, conclaveUser.getOrganisationId())));
Expand Down

0 comments on commit 4c1de29

Please sign in to comment.