Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1412 by [email protected]: Same room hash for different sessionID and account
http://code.google.com/p/openmeetings/issues/detail?id=1412

Hi, I using the SOAP web services for integration into my application. I used an admin account to login and store the session IDs for 2 different users peerA and peerB and use them to generate room Hashes. The first round is ok, when I closed the rooms and try to generate again, the hash will be the same, hence when I open the browser with the hash, openmeetings will complain that the hash is invalid.

Source:

public String getSessionID(String account) throws CollaborationServiceException {
  String sessionID = "";
  UserServiceStub stub = getUserServiceStub();

  try {
    if (account.contains("@")) {
          account = account.substring(0, account.indexOf('@'));
    }
    if (sessionIDMap.containsKey(account.toLowerCase())) {
      sessionID = sessionIDMap.get(account.toLowerCase());
    } else {
          UserServiceStub.Sessiondata sessionData = stub.getSession();
          sessionID = sessionData.getSession_id();
          sessionIDMap.put(account.toLowerCase(), sessionID);
    }
  } catch (final Exception exc) {
    logger.error("Error in getting session", exc);
    throw new CollaborationServiceException("Error in getting session");
  }

  Long lLogin = 0L;
  try {
lLogin = stub.loginUser(sessionID, applicationAccountID, applicationAccountPW);
  } catch (final Exception exc) {
    logger.error("Error in signing in application account", exc);
throw new CollaborationServiceException("Error in signing in application account");
  }

  if (lLogin < 0) {
throw new CollaborationServiceException("Error in signing in application account");
  }

  return sessionID;
}


public String generateRoomHash(final String account, final long roomID) throws CollaborationServiceException {
  System.out.println("CollaborationService.generateRoomHash()");
  String roomHash = null;
  if (account != null && account.length() > 0) {
    final UserServiceStub stub = getUserServiceStub();
    try {
          final String sessionID = getSessionID(account);
      System.out.println("sessionID=" + sessionID);
      System.out.println("account=" + account);
      System.out.println("roomID=" + roomID);
roomHash = stub.setUserObjectAndGenerateRoomHash(sessionID, account, account, "", null, null, 0, null,
                  roomID, 0, 0);
      System.out.println("roomHash=" + roomHash);
    } catch (final Exception exc) {
          logger.error("Error in generating Hash", exc);
          throw new CollaborationServiceException("Error in generating Hash");
    }
  }
  return roomHash;
}


Logs of peerA:
CollaborationService.generateRoomHash()
sessionID=c8fd9f43c09854a02b87ea4afc3844f9
account=peera@geniie
roomID=76
roomHash=4214539669caeb53cd5d164785506557

Logs of peerB:
CollaborationService.generateRoomHash()
sessionID=cccd487e829a19e2666094a612bc2cd6
account=peerb@geniie
roomID=76
roomHash=4214539669caeb53cd5d164785506557

--
You received this message because you are subscribed to the Google Groups 
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/openmeetings-dev?hl=en.

Reply via email to