2014/06/27 T. FURUYA
2015/0222 modified by K.Mori
4. Shibbolethのインストール
参考
https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPMacPortInstallation
※前提として,MacPortとXcode(gcc,make等)がセットアップされていることが必要
※この文書最下部の注参照
・curlを+sslオプションを付けてインストール
$ sudo port install curl +ssl
(curlの他にopensslもインストールされる)
・shibbolethのインストール
$ sudo port install shibboleth
(python,opensamlやらsqlite3も一緒にインストールされる)
(/opt/local/etc/shibboleth に配置、ログは/opt/local/var/log/shibboleth に展開される)
#OSX標準のapache(YosemiteではApache2.4)とport インストールのapache2.2が異なる場合
{
とりあえず,依存パッケージもインストールさせたいので, 普通にインストール
$ sudo port install shibboleth
次に,Shibbolethだけuninstallします.
$ sudo port uninstall shibboleth
次に,ビルドの際の,configureオプションを指定する為に,
shibbolethのPortfileを編集します.
$ sudo port edit shibboleth
(vimが起動します)
その中の,「configure.args」の項目として,次のオプションを追記し,保存終了します.
:
--with-xmlsec=${prefix} \ <--「\」を付加
--enable-apache-22 \
--with-apxs22=/opt/local/apache2/bin/apxs
最後,ソースビルドインストールを実行します.
$ sudo port install -s -d shibboleth
これで,/opt/local/lib/shibbolethに,「mod_shib_22.so」が生成
されたのを確認.
}
・確認
$ port installed
(いずれも,/opt/local 配下にインストールされるので,OS Xシステムに影響なし)
5. Shibbolethの既定Apache設定情報(httpd.conf)を指定の場所(ここではconf/other/)にコピー
$ sudo cp /opt/local/etc/shibboleth/apache22.config /opt/local/apache2/conf/other/shib.conf
6. サーバ証明書(server.crt)とサーバ秘密鍵(server.key)をShibbolethの設定ディレクトリ(/opt/local/etc/shibboleth)内にコピー
$ sudo cp server.crt /opt/local/etc/shibboleth/
$ sudo cp server.key /opt/local/etc/shibboleth/
7. IdPのメタデータを取得して,/opt/local/etc/shibbolethにコピーしておく
$ wget https://vmsimoidp.cc.kagoshima-u.ac.jp/metadata/idp-metadata.xml
(wgetがあれば...)
8. サーバ証明書からSPメタデータを生成
$ sudo ./metagen.sh -c server.crt -h host.hoge.jp -e "https://host.hoge.jp/shibboleth-sp" > sp-metadata.xml
9. 以下のファイルを修正
・/opt/local/etc/shibboleth/shibboleth2.xml
--- shibboleth2.xml.dist 2013-12-03 02:30:17.000000000 +0900
+++ shibboleth2.xml 2013-12-16 16:30:36.534668457 +0900
@@ -20,7 +20,7 @@
-->
<!-- The ApplicationDefaults element is where most of Shibboleth's SAML bits are defined. -->
- <ApplicationDefaults entityID="https://sp.example.org/shibboleth"
+ <ApplicationDefaults entityID="https://hoge.cc.kagoshima-u.ac.jp/shibboleth-sp"
REMOTE_USER="eppn persistent-id targeted-id">
<!--
@@ -41,7 +41,7 @@
(Set discoveryProtocol to "WAYF" for legacy Shibboleth WAYF support.)
You can also override entityID on /Login query string, or in RequestMap/htaccess.
-->
- <SSO entityID="https://idp.example.org/idp/shibboleth"
+ <SSO entityID="https://vmsimoidp.cc.kagoshima-u.ac.jp/idp/shibboleth"
discoveryProtocol="SAMLDS" discoveryURL="https://ds.example.org/DS/WAYF"> SAML2 SAML1
</SSO> @@ -80,9 +80,7 @@
-->
<!-- Example of locally maintained metadata. -->
-
- <!--
-
- <MetadataProvider type="XML" file="partner-metadata.xml"/>
-
- -->
+ <MetadataProvider type="XML" file="/etc/shibboleth/idp-metadata.xml"/>
<!-- Map to extract attributes from SAML assertions. -->
<AttributeExtractor type="XML" validate="true" reloadChanges="false" path="attribute-map.xml"/> @@ -94,7 +92,7 @@
<AttributeFilter type="XML" validate="true" path="attribute-policy.xml"/>
<!-- Simple file-based resolver for using a single keypair. -->
- <CredentialResolver type="File" key="sp-key.pem" certificate="sp-cert.pem"/>
+ <CredentialResolver type="File" key="/etc/shibboleth/server.key" certificate="/etc/shibboleth/server.crt"/>
<!--
The default settings can be overridden by creating ApplicationOverride elements (see
・/opt/local/etc/shibboleth/attribute-map.xml
<attribute name="urn:mace:dir:attribute-def:employeeNumber" id="employeeNumber"/>
と
<attribute name="urn:oid:2.16.840.1.113730.3.1.3" id="employeeNumber"/>
が生きるようにコメント <!--, --> を調整してください。
10. Apache HTTPdの再起動
$ sudo apachectl restart
11. Shibbolethデーモンの起動と登録
$ sudo launchctl load -Fw /Library/LaunchDaemons/org.macports.shibd.plist
(デーモンの停止は)
$ sudo launchctl unload /Library/LaunchDaemons/org.macports.shibd.plist
12. Shibbolethデーモンのログを確認
$ tail -100 /opt/local/var/log/shibboleth/shibd.log | more
13. 何か設定を変更をしたときは,
Apacheの再起動(10)と,Shibbolethデーモンの停止→起動(11)