use of edu.stanford.bmir.protege.web.shared.auth.GetChapSessionResult in project webprotege by protegeproject.
the class GetChapSessionActionHandler method execute.
@Nonnull
@Override
public GetChapSessionResult execute(@Nonnull GetChapSessionAction action, @Nonnull ExecutionContext executionContext) {
UserId userId = action.getUserId();
if (userId.isGuest()) {
logger.info("Attempt at authenticating guest user");
return new GetChapSessionResult(Optional.empty());
}
Optional<Salt> salt = authenticationManager.getSalt(userId);
if (!salt.isPresent()) {
logger.info("Attempt to authenticate non-existing user: {}", userId);
return new GetChapSessionResult(Optional.empty());
}
ChapSession challengeMessage = chapSessionManager.getSession(salt.get());
return new GetChapSessionResult(Optional.of(challengeMessage));
}
Aggregations