PloneでのSP設定例

SPとしてPloneをインストールし、Shibbleth連携させる例を記載します。

これは2009年当時の情報です。



 

0. Javaのインストール

Java 5 以上が必要です。
ただし、CentOSに付属する GNU Java は利用できませんので、SunのJavaを利用してください。

 


1. plone(含むZope)のダウンロード

以下のWebサイトからダウンロードしてください。

http://plone.org/products/plone
※NIIではPlone-3.0.6-UnifiedInstaller.tgzを使用して検証しています。



2. plone(含むZope)のインストール 

(ここでは/tmp/plone配下にダウンロードしたファイルを置いています。)
# tar zxvf Plone-3.0.6-UnifiedInstaller.tgz   ←解凍
# cd /tmp/plone/Plone-3.0.6-UnifiedInstaller
# ./install.sh standalone   ←インストール

次にZopeインスタンスを作成します。

# /opt/Plone-3.0.6/bin/mkzopeinstance.py
Directory: /opt/Plone-3.0.6/zinstance/Products
Username:admin  ←ここではユーザ名を[admin]とした
Password:******  ←パスワードを入力
Verify password::****** ←パスワードを再入力

 


3. サービスの起動

# /opt/Plone-3.0.6/zinstance/bin/runzope 
# /opt/Plone-3.0.6/zinstance/bin/zopectl start

 


4. Plone Siteの生成

①以下のURLにアクセス
http://localhost:8080/manage


②ログイン
[2]で作成したアカウントでログインしてください。


③管理画面の右上のリストボックスから 「Plone Site」 を選択して「add」します。



④「Id」、「Title」、「Menbership source」、「Description」に入力し、「Add Plone Site」を押下します。

「Id」:Plone SiteのIDです。URLの一部となるので、英字のみとしてください。
ここではPloneと入力しました。

「Title」:Plone Siteのタイトルです。Siteを表す名前をつけてください。

「Menbership source」:ユーザの設定をどこで行なうかを、下記の2種類から選択します。

「Create a new user folder in the portal」
 こちらを選択すると、このPlone Site用に新規にユーザフォルダを作成します。通常はこちらを選択することをおすすめします。 
「I have an existing user folder and want to use that instead」
 こちらは、既存のユーザフォルダを使用する設定です。Zopeにすでに多数のユーザが登録されていたり、Zope全体で統一してユーザ情報を扱いたい場合などにはこちらを選択してください。

「Description」:そのPlone SiteがどのようなSiteなのかを説明する文章を記述してください。
 

⑤Webブラウザで http://localhost:8080/plone/ にアクセスすると、下記のようにPloneのトップページが表示されます。

 


5. plone-shibboleth接続設定

①以下のURLから、接続用プラグインをダウンロードします。

【URL】

http://tid.ithaka.org/software

 【ダウンロードファイル】

・AutoUserMakerPASPlugin.zip

・ShibbolethLogin.zip

・ShibbolethPermissions.zip 


②上記のファイルを解凍し、/opt/Plone-3.0.6/zinstance/Products配下に移動します。

③次に、WebブラウザにてPlone を開き(http://localhost:8080/Plone)、管理者アカウントでログインし、[サイト設定] から [アドオンプロダクト] を開きます。

すると、[インストール可能なプロダクト] として、下記3つをチェック入れて、[インストール]ボタンを押してください。

・AutoUserMakerPASPlugin

・ShibbolethLogin

・ShibbolethPermissions


④続いて「Zope管理画面(ZMI)」から「acl_users」を選択します。



⑤次に「AutoUserMakerPASPlugin」を選択します



⑥下記の値を設定し、"save"ボタン"を押下してください。

 

・User Setup Headersにて、下記を設定
  - User ID: HTTP_EPPN
  - user's full name: HTTP_GIVENNAME
  - User's description: HTTP_SHIB_ORGPERSON_TITLE
  - User's email: HTTP_MAIL
  - User's locality: HTTP_SHIB_ORGPERSON_LOCALITY
  - User's state: HTTP_SHIB_ORGPERSON_STATE
  - User's country: HTTP_SHIB_ORGPERSON_C

 

・User Mapping Headersに下記を設定
  - HTTP_EPPN

 

・User Sharing Headersに下記を設定
 (上のボックスに下記2つを設定)
  - HTTP_EPPN
  HTTP_EDUPERSON_ORG_UNIT_DN
 (下のボックスに下記2つを設定)
  - User ID
      Organization 



⑦続いて「AuthZ」タブを選択し、「Values」をHTTP_EPPNに変更してください。


⑧⑤の画面から「Shibboleth Login」を選択し、以下の設定を行い"save"ボタン"をクリックします。

※下記のパスは、shibboleth2.xmlで設定されたものです。
接続するIdPとDSは実績のある upkishib10.nii.ac.jp 、upkishib1.nii.ac.jp とします。 

・The Shibboleth provider IDをブランクにする。

・The URL to use by the Identity Providerに下記を設定
https://upkishibSP.nii.ac.jp/Shibboleth.sso/SAML2/POST

・labels for the URLs belowに下記を設定
- Test IdP
  Test DS

・URLs to redirect to for initiating a session.に下記を設定
https://upkishibSP.nii.ac.jp/Shibboleth.sso/Login
    https://upkishibSP.nii.ac.jp/Shibboleth.sso/DS

The URL to redirect to for terminating a sessionに下記を設定
https://upkishib1.nii.ac.jp/Shibboleth.sso/Logout



⑨ssl.confの修正

(中略)
<VirtualHost _default_:443>
(中略)
   ProxyRequests Off
   ProxyPass /Shibboleth.sso !
   ProxyPass / http://127.0.0.1:8080/VirtualHostBase/https/upkishibSP.nii.ac.jp:443/plone/VirtualHostRoot/
   <Location />
     AuthType shibboleth
     ShibRequestSetting requireSession false
     ShibUseHeaders On
     Require shibboleth
   </Location>
(中略)
</VirtualHost>

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。

 

⑩/etc/shibboleth/attribute-map.xmlの編集

<!-- First some useful eduPerson attributes that many sites might use. -->

(中略)

<Attribute name="urn:mace:dir:attribute-def:eduPersonAffiliation" id="unscoped-affiliation">  ←コメント化
  ↓
<Attribute name="urn:mace:dir:attribute-def:eduPersonAffiliation" id="eduPerson_Affiliation"> ←置換
(中略)
<Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" id="unscoped-affiliation">  ←コメント化
  ↓
<Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" id="eduPerson_Affiliation"> ←置換
(中略)
<!-- Some more eduPerson attributes, uncomment these to use them... --> ←このタグ配下のコメントを外す
(中略)
<!--Examples of LDAP-based attributes, uncomment to use these... -->  ←このタグ配下のコメントを外す
(中略)

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。
 
⑪/etc/shibboleth/attribute-policy.xmlの編集

 

以下のコメント化はデバッグのためのものです、本運用ではコメントアウトしたままにしないよう、くれぐれもご注意ください。

 

 

 

(中略)
<!--         <afp:AttributeRule attributeID="affiliation">  ←コメント化
             <afp:PermitValueRule xsi:type="AND">
               <RuleReference ref="eduPersonAffiliationValues"/>
               <RuleReference ref="ScopingRules"/>
             </afp:PermitValueRule>
           </afp:AttributeRule>
           <afp:AttributeRule attributeID="unscoped-affiliation">
             <afp:PermitValueRuleReference ref="eduPersonAffiliationValues"/>
           </afp:AttributeRule>
           <afp:AttributeRule attributeID="eppn">
             <afp:PermitValueRuleReference ref="ScopingRules"/>
           </afp:AttributeRule>  -->
(中略)

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。

 ⑫IdP側の属性設定(IdPにupkishib10.nii.ac.jpを利用する場合は、設定済みです。)

■/opt/shibboleth-idp-2.0.0/conf/attribute-resolver.xml

(中略)
   <!-- Schema: Core schema attributes-->
(中略)
    <resolver:AttributeDefinition id="email" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
        sourceAttributeID="mail">          ←有効化
        <resolver:Dependency ref="myLDAP" />
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:mace:dir:attribute-def:mail" />
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" />
    </resolver:AttributeDefinition>
    <resolver:AttributeDefinition id="givenName" xsi:type="Simple"   ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:ad"    sourceAttributeID="givenName">
        <resolver:Dependency ref="myLDAP" />
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:mace:dir:attribute-def:givenName" />
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:oid:2.5.4.42" friendlyName="givenName" />
    </resolver:AttributeDefinition>
(中略)
<!-- Schema: eduPerson attributes -->
   <resolver:AttributeDefinition id="eduPersonAffiliation" xsi:type="Simple"   ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:ad"   sourceAttributeID="eduPersonAffiliation">
        <resolver:Dependency ref="myLDAP" />
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:mace:dir:attribute-def:eduPersonAffiliation" />
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" friendlyName="eduPersonAffiliation" />
    </resolver:AttributeDefinition>
    <resolver:AttributeDefinition id="eduPersonEntitlement" xsi:type="Simple"  ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:ad"    sourceAttributeID="eduPersonEntitlement">
        <resolver:Dependency ref="myLDAP" />
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:mace:dir:attribute-def:eduPersonEntitlement" />
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:oid:1.3.6.1.4.1.5923.1.1.1.7" friendlyName="eduPersonEntitlement" />
    </resolver:AttributeDefinition>
    <resolver:AttributeDefinition id="eduPersonOrgUnitDN" xsi:type="Simple"  ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:ad"    sourceAttributeID="eduPersonOrgUnitDN">
        <resolver:Dependency ref="myLDAP" />
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:mace:dir:attribute-def:eduPersonOrgUnitDN" />
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
            name="urn:oid:1.3.6.1.4.1.5923.1.1.1.4" friendlyName="eduPersonOrgUnitDN" />
    </resolver:AttributeDefinition>
    <resolver:AttributeDefinition id="principalName" xsi:type="Scoped"  ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:ad" scope="nii.ac.jp" sourceAttributeID="remoteUser">
        <resolver:Dependency ref="remoteUser" />
        <resolver:AttributeEncoder xsi:type="SAML1ScopedString"
xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
name="urn:mace:dir:attribute-def:eduPersonPrincipalName" />
        <resolver:AttributeEncoder xsi:type="SAML2ScopedString"
xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="urn:oid:1.3.6.1.4.1.5923.1.1.1.6"
friendlyName="eduPersonPrincipalName" />
    </resolver:AttributeDefinition>
    <resolver:AttributeDefinition xsi:type="PrincipalName" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
 id="remoteUser" /> ←追加
(中略)
   <!-- ========================================== -->
    <!--      Data Connectors                       -->
    <!-- ========================================== -->
    <!-- Example Static Connector -->   ←このタグにある定義をすべてコメント化
(中略)
    <!-- Example LDAP Connector -->
    <resolver:DataConnector id="myLDAP" xsi:type="LDAPDirectory"  ←有効化
xmlns="urn:mace:shibboleth:2.0:resolver:dc"
        ldapURL="ldap://upkishib10.nii.ac.jp" baseDN="o=Test_University_A,dc=ac,c=JP"  ←LDAPに合わせて修正
principal="cn=olmgr,o=Test_University_A,dc=ac,c=JP"               
        principalCredential="csildap">
        <FilterTemplate>
            <![CDATA[
                (eduPersonPrincipalName=$requestContext.principalName)
            ]]>
        </FilterTemplate>
    </resolver:DataConnector>
(中略)

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。

※接続するLDAPがない場合は、
1)<resolver:Dependency ref="myLDAP" /> を
<resolver:Dependency ref="staticAttributes" />に変更し、
 
2)<!-- Example Static Connector -->
  <resolver:DataConnector id="staticAttributes" xsi:type="Static"
 xmlns="urn:mace:shibboleth:2.0:resolver:dc">タグ内で
上記の項目をstaticに定義してください。

■/opt/shibboleth-idp-2.0.0/conf/attribute-filter.xml

以下の設定では全てのSPに対して当該属性を送信してしまいます。本運用では各SPに対して個別にAttributeFilterPolicyを設定してその中で送信する属性を指定してください。

(中略)
    <!-- Example Static Connector -->   
    <!--  Release the transient ID to anyone -->
    <AttributeFilterPolicy id="releaseTransientIdToAnyone">
        <AttributeRule attributeID="transientId">  ←有効化
            <PermitValueRule xsi:type="basic:ANY" />
        </AttributeRule>
        <AttributeRule attributeID="principalName">  ←有効化
            <PermitValueRule xsi:type="basic:ANY" />
        </AttributeRule>
        <AttributeRule attributeID="givenName">  ←有効化
            <PermitValueRule xsi:type="basic:ANY" />
        </AttributeRule>
        <AttributeRule attributeID="eduPersonAffiliation">  ←有効化
            <PermitValueRule xsi:type="basic:ANY" />
        </AttributeRule>
        <AttributeRule attributeID="eduPersonOrgUnitDN">  ←有効化
            <PermitValueRule xsi:type="basic:ANY" />
        </AttributeRule>
(中略)

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。

⑬サーバ証明書の設定

■接続するSPのサーバ証明書が、IdP側の/opt/shibboleth-idp-2.0.0/metadata/idp-metadata.xmlに登録されているか確認してください。

(中略)
       <EntityDescriptor entityID="https://upkishibSP.nii.ac.jp/idp/shibboleth"> ←ホスト名
       <IDPSSODescriptor protocolSupportEnumeration="urn:mace:shibboleth:1.0
urn:oasis:names:tc:SAML:2.0:protocol">
          <KeyDescriptor>
             <ds:KeyInfo>
                <ds:X509Data>
                   <ds:X509Certificate>
※入手した証明書に変更
MIIDOzCCAiOgAwIBAgIUdTJ6oiEccCjrtDyDaeBXTlRpfPcwDQYJKoZIhvcNAQEF
BQAwHzEdMBsGA1UEAxMUdXBraXNoaWIxMS5uaWkuYWMuanAwHhcNMDgwNzA4MTAz
NTQwWhcNMjgwNzA4MTAzNTQwWjAfMR0wGwYDVQQDExR1cGtpc2hpYjExLm5paS5h
Yy5qcDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJlkO5kZI2Tz7tPg
1HVHwv7g7bCYNL7Zx11IeNwDyd1ZluRAfmSzTNP67YPSMPLaA4upkYM51JmHgskZ
GvbjNqfma+imNVo/R7J0LL6ucSgL++ax25XKJmViCspQpgYPiFsavoF6JwciRdwk
zeUkhJo0zZWZ1rSxeAevAuWJf9hDwelCyry5u2ZNljDNLFl6uzpPETv3DSMxwevs
tHggaq9917DSnH4ZhiBhXL3pd+g0qyw0ouuew9wtizZ6KpTtTIl3InuTM6KiCG5M
Iyv7HVc9KtwkVAooF/LMPP9ofkZeuqzpc8T6Wg+zaUUsIKhEDhon4Zb/rt9tS3vB
JFpYBS8CAwEAAaNvMG0wTAYDVR0RBEUwQ4IUdXBraXNoaWIxMS5uaWkuYWMuanCG
K2h0dHBzOi8vdXBraXNoaWIxMS5uaWkuYWMuanAvaWRwL3NoaWJib2xldGgwHQYD
VR0OBBYEFCoPX1gOojzXlCTZT7l73KcHkJSHMA0GCSqGSIb3DQEBBQUAA4IBAQAW
GnudDV3eqTNLZPGH8zJWHCT8Az7CtG40aINRJzirbZI+r4X7Zuq5ZLv+n9EJ6rbd
xRWh6bIx9YTLKcLvzXx0ZM4fy6RFyJ+8qCDTXig0qDgVpng66xfJBi7ahjGIJgn6
xXwdYFE50zLC3qwrZ9kykXCy2ELLHfb3Z/g1o9fZZy7gjn77m1tDfWcs4M3NFCfL
zKbGNi+5a05w/wLkxpEaP8NPTHkbN3E+EXQDik7QQOqGJ0+JEUYLAPO6HTGGCs5i
YU+cTQ5QSgjfsSwcZQt6ljQUzlyhKOAWnazbrRGVfCVlwoYl0hkpmGMSb4Jjxo6E
61psWSAHlehx6L2F9Eat

(中略)

※端末のサイズによっては表記がずれる可能性がございます。画面を広くしてご覧ください。

■同様に、接続するIdPのサーバ証明書が、SP側の/etc/shibboleth/ partner-metadata.xmlに登録されているか確認してください。

 


6. 接続確認

①Ploneサイトにアクセスする
 https://(貴学のSPサイト)/Plone 

②ログインする
 
 

③ログインユーザの属性情報を確認する