
我有一個在 WordPress 中運行的多站點應用程式。我的一位客戶最近要求為他們的組織提供 SSO,並特別要求我使用 shibboleth。但是,我的所有其他子網域都需要使用我的網站本機的預設登入/註冊頁面。我已經安裝了 shibboleth,並讓 SP 在具有啟用網站的測試伺服器上透過 IdP 進行身份驗證。然而,現在當我轉移到多網站時,我不確定如何「告訴」shibboleth apache 模組根據請求 HTTP 請求來保護內容。
例如,假設 sp.shibboleth.com 使用 SSO,而 sp1.shibboleth.com 不使用 SSO。但是,每個子網域顯示的頁面與同一目錄中的內容完全相同。我該如何將 shibboleth 配置為對 sp 子域有效,但對 sp1 子域無效?
謝謝。
答案1
對於 Apache,您可以透過與 HTTP Basic auth 非常相似的選項強制使用 Shibboleth,並且類似地可以在 VirtualHost 層級設定它們,例如:
<VirtualHost *:443>
ServerName site1.example.com
# Useful to distinguish multiple sites within shibboleh.xml
# (for giving them different entityIDs)
<Location />
ShibRequestSetting applicationId site1
</Location>
<Location /Shibboleth.sso>
SetHandler shib
</Location>
# The actual path you want to protect
<Location /wp-whatever>
AuthType Shibboleth
ShibRequestSetting requireSession On
Require shib-session
</Location>
</Location>
此虛擬主機中的選項不會影響您的任何其他虛擬主機。
(註:這是針對 Shibboleth SP 3.x - 我認為它曾經Require valid-user
在 SP 2.x 中。)