2015-06-13 53 views
1

單註銷這是在延續我以前的問題實施simplesamlphp

Central login with SAML and making site to work as identity provider

現在我在cauth.com也a.com(或b.com)。什麼可以成爲最好的會議通過單擊「註銷」按鈕註銷兩個站點上的會話。

這是cauth.com

public function actionSlo(){ 
     $metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); 
     $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); 
    $idp = \SimpleSAML_IdP::getById('saml2:' . $idpEntityId); 
     \sspmod_saml_IdP_SAML2::receiveLogoutMessage($idp); 
     assert('FALSE'); 

     //destroy session 
     session_destroy(); 

     //redirect to the spentity 
     $spId = $_GET['spentityid']; 
     header("location:".$spId); 

    } 

的代碼,我有維滕的註銷這在我看來,註銷將於3 HTTP重定向

1。當用戶點擊「註銷」時,請求的頁面是cauth.com/slo。

  1. 然後從此用戶將被帶到主站點(a.com或b.com)的註銷。

  2. 用戶將被重定向到主站點的索引頁面。

我想知道有沒有什麼辦法讓我可以處理SAML註銷內部減少HTTP的轉發數量牢記我必須清除出在這兩個網站的會話變量?

+0

嗨@alwaysLearn破壞當前用戶會話,你有沒有固定的問題?我有同樣的問題,如果你解決了這個問題,請和你的答案一起編輯。謝謝。 – Kuttoozz

回答

0

嘗試清除用戶會話中

cauth.com((cauth.com/logout)) 

清晰的用戶會話之前需要啓動用戶會話和

session_start();  
session_unset(); 
session_destroy(); 
+0

對不起,這不回答我的問題。當然,我知道如何銷燬會議。請再次閱讀我的問題 – alwaysLearn