You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2020/04/07 01:36:07 UTC

[openmeetings] branch master updated: [OPENMEETINGS-2192] additional logs are added

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 25faddb  [OPENMEETINGS-2192] additional logs are added
25faddb is described below

commit 25faddb3ca26ab4656d94c660a79f89cd210f3f9
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Apr 7 08:35:53 2020 +0700

    [OPENMEETINGS-2192] additional logs are added
---
 .../main/java/org/apache/openmeetings/web/app/WebSession.java | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java
index 4725e28..b5a2404 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java
@@ -227,10 +227,13 @@ public class WebSession extends AbstractAuthenticatedWebSession implements IWebS
 	}
 
 	public void checkHashes(StringValue secure, StringValue invitation) {
+		log.debug("checkHashes, secure: '{}', invitation: '{}'", secure, invitation);
 		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);
@@ -238,6 +241,7 @@ public class WebSession extends AbstractAuthenticatedWebSession implements IWebS
 			if (!invitation.isEmpty() && (i == null || !i.getHash().equals(invitation.toString()))) {
 				// otherwise already logged-in with the same hash
 				if (isSignedIn()) {
+					log.debug("invitation: Session is authorized, going to invalidate");
 					invalidateNow();
 				}
 				i = inviteDao.getByHash(invitation.toString(), false);
@@ -269,15 +273,20 @@ public class WebSession extends AbstractAuthenticatedWebSession implements IWebS
 	public boolean signIn(String secureHash, boolean markUsed) {
 		SOAPLogin soapLogin = soapDao.get(secureHash);
 		if (soapLogin == null) {
+			log.warn("Secure hash not found in DB");
 			return false;
 		}
+		log.debug("Secure hash found, is used ? {}", soapLogin.isUsed());
 		if (!soapLogin.isUsed() || soapLogin.getAllowSameURLMultipleTimes()) {
 			Sessiondata sd = sessionDao.check(soapLogin.getSessionHash());
+			log.debug("Do we have data for hash ? {}", (sd.getXml() != null));
 			if (sd.getXml() != null) {
 				RemoteSessionObject remoteUser = RemoteSessionObject.fromString(sd.getXml());
+				log.debug("Hash data was parsed successfuly ? {}, containg exterlaId ? {}", (remoteUser != null), !Strings.isEmpty(remoteUser.getExternalId()));
 				if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalId())) {
 					Room r = roomDao.get(soapLogin.getRoomId());
 					if (r == null) {
+						log.warn("Room was not found");
 						return false;
 					}
 					redirectHash(r, () -> {});
@@ -312,10 +321,12 @@ public class WebSession extends AbstractAuthenticatedWebSession implements IWebS
 					setUser(user, null);
 					recordingId = soapLogin.getRecordingId();
 					soap = soapLogin;
+					log.info("Hash was authorized");
 					return true;
 				}
 			}
 		}
+		log.warn("Hash was NOT authorized");
 		return false;
 	}