in openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java [221:266]
public void checkHashes(StringValue secure, StringValue inviteStr) {
log.debug("checkHashes, secure: '{}', invitation: '{}'", secure, inviteStr);
try {
log.debug("checkHashes, has soap in session ? '{}'", (soap != null));
if (!secure.isEmpty() && (soap == null || !soap.getHash().equals(secure.toString()))) {
// otherwise already logged-in with the same hash
if (isSignedIn()) {
log.debug("secure: Session is authorized, going to invalidate");
invalidateNow();
}
signIn(secure.toString(), true);
}
if (!inviteStr.isEmpty()) {
// invitation should be re-checked each time, due to PERIOD invitation can be
// 1) not ready
// 2) already expired
// otherwise already logged-in with the same hash
if (isSignedIn()) {
log.debug("invitation: Session is authorized, going to invalidate");
invalidateNow();
}
invitation = inviteDao.getByHash(inviteStr.toString(), false);
Room r = null;
if (invitation != null && invitation.isAllowEntry()) {
Set<Right> hrights = new HashSet<>();
if (invitation.getRoom() != null) {
r = invitation.getRoom();
} else if (invitation.getAppointment() != null && invitation.getAppointment().getRoom() != null) {
r = invitation.getAppointment().getRoom();
} else if (invitation.getRecording() != null) {
recordingId = invitation.getRecording().getId();
}
if (r != null) {
redirectHash(r, () -> inviteDao.markUsed(invitation));
hrights.add(Right.ROOM);
roomId = r.getId();
}
setUser(invitation.getInvitee(), hrights);
}
}
} catch (RedirectToUrlException e) {
throw e;
} catch (Exception e) {
log.error("Unexpected exception while checking hashes", e);
}
}