2017-04-18 93 views
0

我正在編寫代碼以登錄來自另一個應用程序的openmeetings來自另一個應用程序的SSO登錄,並且希望通過使用API​​直接進入房間。Openmeetings:從另一個應用程序登錄到SSO登錄中的openmeetings

我嘗試以下步驟:

  1. 使用下面的代碼獲取SID:

    $.ajax({ 
        method: "GET", 
        url: "http://localhost:5080/openmeetings/services//user/login", 
        data: {user: 'amit.k', pass: 'Mind1234'}, 
        dataType: "json", 
        error : function(jqXHR) { 
            console.log(jqXHR.responseText); 
           }, 
           success : function(result) { 
            getHashAndEnterRoom(result.serviceResult.message);                 
           } 
    }); 
    
  2. 利用SID從上面的函數獲取哈希鍵,並嘗試在房間進入:

    function getHashAndEnterRoom(sid){ 
    
    $.ajax({ 
         method: "POST", 
         url: "http://localhost:5080/openmeetings/services/user/hash?sid="+sid, 
         data: {user: JSON.stringify({ 
          firstname: 'John', 
          lastname: 'Doe', 
          externalId: 'uid1', 
          externalType: 'myCMS', 
          login: 'superjohn' 
          }), 
         options: JSON.stringify({ 
          roomId: 5, 
          moderator: true, 
          showAudioVideoTest: true 
          }) 
         }, 
         dataType: "json", 
          error : function(jqXHR) { 
              }, 
          success : function(result) { 
    
          var url ="http://localhost:5080/openmeetings/swf?secureHash="+result.serviceResult.message+"&;language"; 
    
              OR 
    
          var url ="http://localhost:5080/openmeetings/swf?secureHash="+result.serviceResult.message+"&;language=1#room/2"; 
              window.location=url; 
          } 
        }) 
    

我成功獲得了SID,哈希鍵也獲得了成功,但是當我嘗試導航到URL(window.location)時,它每次都顯示登錄屏幕。

我被困在這裏,因爲幾天,但沒有成功s請指導我會感謝你完全。

在此先感謝。

回答

0

最終URL是錯誤的

// Instead of 

var url ="http://localhost:5080/openmeetings/swf?secureHash="+result.serviceResult.message+"&;language=1#room/2"; 

// you should use 

var url ="http://localhost:5080/openmeetings/hash?secure="+result.serviceResult.message+"&;language=1#room/2";