子ページ
  • Full SLO(Single Logout)の設定方法

このページの古いバージョンを表示しています。現在のバージョンを表示します。

現在のバージョンとの相違点 ページ履歴を表示

« 前のバージョン バージョン 8 次のバージョン »

ShibbolethにおけるSLO (Single Logout) の設定方法を記載します。

前提

IdP/SPはそれぞれ以下のバージョンであることを前提とします。

  • IdP: 3.2.1
  • SP : 2.6.0

IdPの設定

メタデータへ<SingleLogoutService>を追加

IdPのメタデータに <IDPSSODescriptor> の子要素として <SingleLogoutService> を追加します。LocationのIdPのホスト名部分は適宜読み替え適切に設定して下さい。IdPが特殊な設定でなければ、ホスト名部分のみ合わせれば問題ありません。

       </ds:KeyInfo>
    </KeyDescriptor>
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://IdPのホスト名/idp/profile/SAML2/POST/SLO"/> ← 追加
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://IdPのホスト名/idp/profile/SAML2/Redirect/SLO"/> ← 追加
    <NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
    <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
    <SingleSignOnService Binding="urn:mace:shibboleth:1.0:profiles:AuthnRequest" Location="https://IdPのホスト名/idp/profile/Shibboleth/SSO"/>
    <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://IdPのホスト名/profile/SAML2/POST/SSO"/>
    <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://IdPのホスト名/idp/profile/SAML2/Redirect/SSO"/>
  </IDPSSODescriptor>

メタデータ内の要素は並び順が決まっているものがありますので注意してください。特に<IDPSSODescriptor>の子要素については下記の順番となるように<SingleLogoutService>を挿入してください。

  • <KeyDescriptor>
  • <ArtifactResolutionService>
  • <SingleLogoutService>
  • <NameIDFormat>
  • <SingleSignOnService>
  • (ds:Signature)
  • md:Extensions
  • md:KeyDescriptor
  • (md:Organization)
  • (md:ContactPerson)
  • md:ArtifactResolutionService
  • md:SingleLogoutService
  • md:ManageNameIDService
  • md:NameIDFormat
  • md:SingleSignOnService
  • md:NameIDMappingService
  • md:AssertionIDRequestService
  • md:AttributeProfile
  • saml:Attribute
idp.propertiesの変更

idp.propertiesの以下の箇所を変更します。

/opt/shibboleth-idp/conf/idp.properties の設定

# Configuration of client- and server-side storage plugins
#idp.storage.cleanupInterval = PT10M
idp.storage.htmlLocalStorage = true ← アンコメントして変更

# Set to true to expose more detailed errors in responses to SPs
(省略)

# Track information about SPs logged into
idp.session.trackSPSessions = true ← アンコメントして変更
# Support lookup by SP for SAML logout
idp.session.secondaryServiceIndex = true ← アンコメントして変更
# Length of time to track SP sessions
#idp.session.defaultSPlifetime = PT2H

また、SLOとして必須ではありませんが、以下の箇所を変更することでSLO実行時に画面に表示されるSPの情報がURLからメタデータ由来のDisplayNameに変化します。

/opt/shibboleth-idp/conf/idp.properties の変更

# Whether to lookup metadata, etc. for every SP involved in a logout
# for use by user interface logic; adds overhead so off by default.
idp.logout.elaboration = true ← アンコメントして変更

idp.logout.elaboration の影響

idp.logout.elaboration=false の場合

idp.logout.elaboration=true の場合

SPの設定

shibboleth2.xmlの設定

SPでのログアウトをトリガーとしてSLOを駆動するためには、shibboleth2.xmlのSessions要素内のLogout要素に以下のように"SAML2"が設定されている必要があります。デフォルト設定ですので、変更していない場合は追加設定は不要ですが、"SAML2"の部分が削除されている場合は追加してください。

            <!-- SAML and local-only logout. -->
            <Logout>SAML2 Local</Logout>

メタデータへ<SingleLogoutService>を追加

SPのメタデータに <SPSSODescriptor> の子要素として <SingleLogoutService> を追加します。LocationのSPのホスト名部分は適宜読み替え適切に設定して下さい。SPが特殊な設定でなければ、ホスト名部分のみ合わせれば問題ありません。

      </ds:KeyInfo>
    </KeyDescriptor>
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://SPのホスト名/Shibboleth.sso/SLO/POST"/> ← 追加
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://SPのホスト名/Shibboleth.sso/SLO/Redirect"/> ← 追加
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://SPのホスト名/Shibboleth.sso/SAML2/POST" index="1" isDefault="true"/>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" Location="https://SPのホスト名/Shibboleth.sso/SAML2/POST-SimpleSign" index="2"/>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact" Location="https://SPのホスト名/Shibboleth.sso/SAML2/Artifact" index="3"/>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post" Location="https://SPのホスト名/Shibboleth.sso/SAML/POST" index="4"/>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01" Location="https://SPのホスト名/Shibboleth.sso/SAML/Artifact" index="5"/>
    <AttributeConsumingService index="1" isDefault="true">
(省略)
  </SPSSODescriptor>

メタデータ内の要素は並び順が決まっているものがありますので注意してください。特に<SPSSODescriptor>の子要素については下記の順番となるように<SingleLogoutService>を挿入してください。

  • <KeyDescriptor>
  • <SingleLogoutService>
  • <NameIDFormat>
  • <AssertionConsumerService>
  • <AttributeConsumingService>
  • (ds:Signature)
  • md:Extensions
  • md:KeyDescriptor
  • (md:Organization)
  • (md:ContactPerson)
  • md:ArtifactResolutionService
  • md:SingleLogoutService
  • md:ManageNameIDService
  • md:NameIDFormat
  • md:AssertionConsumerService
  • md:AttributeConsumingService

SLOの実行

SP-initiatedのSLO

ログインしているSPの次のURLにアクセスすることで、接続しているIdP、及びIdPとの間に認証セッションが確立している全てのSPからログアウトします。

https://SPのホスト名/Shibboleth.sso/Logout

この操作によりIdPからログアウトするためには、前述したIdPのメタデータへの<SingleLogoutService>の追加が必要です。

また、他のSPからログアウトするためには、そのSP側で、前述したSPのメタデータへの<SingleLogoutService>の追加が実施されている必要があります。

https://SPのホスト名/Shibboleth.sso/Logout にアクセス後の画面遷移

ログアウト対象となるSPの一覧が表示されますがアクセスしたSPは表示されません。

 

上記画面で Yes を選択、或いは規定の秒数経過後の画面遷移

Full SLOに対応しているSPにはが表示され、対応していないSPにはが表示されます。

上記画面で No を選択後の画面遷移

アクセスしたSP及びIdPからはログアウトされますが他のSPからはログアウトされません。

 

https://SPのホスト名/Shibboleth.sso/Logout にアクセスした際に他のSPにログインしていない場合の画面遷移

 

IdP-initiatedのSLO

ログインしているIdPの次のURLにアクセスすることで、アクセスしたIdP、及びIdPとの間に認証セッションが確立している全てのSPからログアウトします。

https://IdPのホスト名/idp/profile/Logout

この操作によりSPからログアウトするためには、SP側で、前述したSPのメタデータへの <SingleLogoutService> の追加が実施されている必要があります。

https://IdPのホスト名/idp/profile/Logout にアクセス後の画面遷移

ログアウト対象となる認証セッションが確立している全てのSPが一覧に表示されます。

 

上記画面で Yes を選択、或いは規定の秒数経過後の画面遷移

Full SLOに対応しているSPにはが表示され、対応していないSPにはが表示されます。

上記画面で No を選択後の画面遷移

IdPからはログアウトされますがSPからはログアウトされません。

IdP 3.2.1時点では上記操作実行後Webブラウザが次のようなエラーメッセージを表示する画面へ遷移し、SPからのログアウトが実施されません。(IdPからはログアウトされています)

本件はIdP 3.3.0リリースで修正される予定です。

参考: IDP-892IDP-956

--

SPのSLO対応について、Shibbolethセッションを使ってWebアプリケーションを構成している場合はこの手順で完了ですが、Webアプリケーションで独自のセッションを管理している場合、Shibbolethセッションと連動させるためにいくつかの改修が必要です。

  1. アプリケーションセッション中でもShibbolethセッションがなくなっていればセッションを終了させる。
  2. Webアプリケーションにおけるログアウトのタイミングで/Shibboleth.sso/Logoutを呼ぶ。
    参考: GakuNinShare - 設定・運用・カスタマイズ - WebアプリケーションのログアウトフローへのShibbolethログアウト処理の挿入
  3. (SLOの通知を受けセッションを破棄する)
    参考: https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPNotify
    ※これがなくても次回アクセス時に1.の処理でセッションは破棄されるはずです。厳密なセッション管理を行うなら。

参考: https://wiki.shibboleth.net/confluence/display/SHIB2/SLOWebappAdaptation

 

参考:

  • ラベルがありません