Neseek77 / openmeetings

Automatically exported from code.google.com/p/openmeetings
1 stars 0 forks source link

Same room hash for different sessionID and account #1412

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by elvin...@gmail.com on 23 Jun 2011 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by seba.wag...@gmail.com on 31 Jan 2012 at 12:23

GoogleCodeExporter commented 9 years ago
OpenMeetings moves to Apache Foundation, update your bookmarks to the new 
project page:

http://incubator.apache.org/openmeetings/

New Issue tracker is located: https://issues.apache.org/jira/browse/OPENMEETINGS

New Mailing Lists located at: 
http://incubator.apache.org/openmeetings/mail-lists.html 

Original comment by seba.wag...@gmail.com on 31 Jan 2012 at 12:25