#author("2020-05-31T11:16:31+09:00","default:tanak0to","tanak0to") RIGHT:[[フリーソフトウェアのコンパイル]] *Shibboleth SP のインストール [#la694f14] **環境 [#n955d177] RHEL8 **パッケージインストール [#ce10a1b1] Shibboleth用のrepositoryファイルをダウンロード. # wget https://shibboleth.net/cgi-bin/sp_repo.cgi?platform=CentOS_8 yum に repository ファイルを追加 # cp sp_repo.cgi\?platform=* /etc/yum.repos.d/shibboleth.repo Shibbolethのインストール # yum install shibboleth **httpd 設定 /etc/httpd/conf.d/ssl.conf にて,ServerNameを設定. ServerName shib-sp.example.jp:443 **shibd 起動 [#q17d01c3] # systemctl start shibd # systemctl enable shibd # systemctl restart httpd *Shibboleth SPの設定 [#qa7d3c58] https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=21443867 shibboleth2.xml の編集 https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=12158266 //https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=21443856 学認運用フェデレーションのメタデータ検証用証明書をダウンロード https://metadata.gakunin.nii.ac.jp/gakunin-signer-2017.cer /etc/shibboleth/cert 配下にメタデータ検証用をコピー # cp gakunin-signer-2017.cer /etc/shibboleth/cert/ /etc/shibboleth/cert 配下にサーバ証明書と秘密鍵をコピー # mkdir /etc/shibboleth/cert # cp /etc/pki/tls/private/server.key /etc/shibboleth/cert/ # cp /etc/pki/tls/certs/server.crt /etc/shibboleth/cert/ /etc/shibboleth/cert/server.key はユーザ shibd によって読み取れる必要がある. Shibboleth SP のデフォルト設定である以下を参考にパーミッションを限定する. # chown shibd:shibd /etc/shibboleth/cert/server.key # chmod 440 /etc/shibboleth/cert/server.key /etc/shibboleth/shibboleth2.xml の該当する部分を変更 <!-- Simple file-based resolvers for separate signing/encryption keys. --> <CredentialResolver type="File" use="signing" key="cert/server.key" certificate="cert/server.crt"/> ↑秘密鍵の格納先 ↑サーバ証明書の格納先 <CredentialResolver type="File" use="encryption" key="cert/server.key" certificate="cert/server.crt"/> ↑秘密鍵の格納先 ↑サーバ証明書の格納先 *Shibboleth SP と Moodle 連携の設定 [#x692c764] /var/www/html/moodle/auth/shibboleth/README.txt 1. moodle/auth/shibboleth/index.php をShibboleth で保護. <Directory /var/www/html/auth/shibboleth/index.php> AuthType shibboleth ShibRequireSession On require valid-user </Directory> 2. Moodle に admin でログインし,'サイト管理 > プラグイン > 認証'を表示, 'Shibboleth' をクリック. 3. 必要事項を入力. -Username -First name -eppn -jaGivenName -jasn -mail *学内システムとして構築する場合の設定 [#u6edb9df] https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=12158282 メタデータ中の特定のIdPのみ利用を許可する方法 https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=10226458#id-%E8%A8%AD%E5%AE%9A%E3%83%BB%E9%81%8B%E7%94%A8%E3%83%BB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA-%E3%83%A1%E3%82%BF%E3%83%87%E3%83%BC%E3%82%BF%E4%B8%AD%E3%81%AE%E7%89%B9%E5%AE%9A%E3%81%AEIdP%E3%81%AE%E3%81%BF%E5%88%A9%E7%94%A8%E3%82%92%E8%A8%B1%E5%8F%AF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95 **MetadataProvider の設定(IdP が学認に登録されていればこれは必要ないはず.) [#t6c8699b] idp のメタデータ(学認の一覧から切り取り)を mahara の /etc/shibboleth/idp-metadata.xml に置く. で,/etc/shibboleth2.xml の編集 <!-- Example of locally maintained metadata. --> <!-- コメントアウト解除 --> <MetadataProvider type="XML" file="idp-metadata.xml"/> <!-- コメントアウト解除 --> (中略) <SSO entityID="https://shibboleth-idp.example.jp/idp/shibboleth" discoveryProtocol="SAMLDS" discoveryURL="https://ds.example.org/DS/WAYF"> SAML2 </SSO> **MetadataProvider の設定(IdP が学認に登録されている場合は多分こちら.) [#kce6af1c] https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=12158282 https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=10226458#id-%E8%A8%AD%E5%AE%9A%E3%83%BB%E9%81%8B%E7%94%A8%E3%83%BB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA-%E3%83%A1%E3%82%BF%E3%83%87%E3%83%BC%E3%82%BF%E4%B8%AD%E3%81%AE%E7%89%B9%E5%AE%9A%E3%81%AEIdP%E3%81%AE%E3%81%BF%E5%88%A9%E7%94%A8%E3%82%92%E8%A8%B1%E5%8F%AF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95 /etc/shibboleth2.xml の編集 <MetadataProvider type="XML" uri="https://metadata.gakunin.nii.ac.jp/gakunin-metadata.xml" backingFilePath="federation-metadata.xml" reloadInterval="7200"> <MetadataFilter type="RequireValidUntil" maxValidityInterval="1296000"/> <MetadataFilter type="Signature" certificate="/etc/shibboleth/cert/gakunin-signer-2010.cer"/> <MetadataFilter type="Whitelist"> <Include>(...IdPのentityID...)</Include> <Include>https://shibboleth-idp.example.jp/idp/shibboleth</Include> → Includeの行を増やすことで、連携するIdPを増やすことができます </MetadataFilter> </MetadataProvider> <!-- コメントアウト解除 --> (中略) <SSO entityID="https://shibboleth-idp.example.jp/idp/shibboleth" discoveryProtocol="SAMLDS" discoveryURL="https://ds.example.org/DS/WAYF"> SAML2 </SSO> (中略) <!-- コメントアウト <SessionInitiator type="Chaining" Location="/DS" isDefault="true " id="DS"> <SessionInitiator type="SAML2" template="bindingTemplate.html"/> <SessionInitiator type="Shib1"/> <SessionInitiator type="SAMLDS" URL="https://ds.gakunin.nii.ac.jp/WAYF"/> </SessionInitiator> コメントアウト --> **IdP 側の設定 [#x8d49731] ***(1)Shibbolet SP のメタデータを IdP に配置 [#aa5ccada] https://shib-sp.example.jp/Shibboleth.sso/Metadata で取得できる SP のメタデータ(shib-sp-metadata.xml)を IdP の /opt/shibboleth-idp/metadata/ に転送する. IdP の conf/metadata-providers.xml を編集 https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=12158282 を参照 最後から 2行目ぐらいに以下を追加 <MetadataProvider id="sp-shib" xsi:type="FilesystemMetadataProvider" metadataFile="%{idp.home}/metadata/shib-sp-metadata.xml"/> ***(2)新規SPの登録 [#k6c52d05] /opt/shibboleth-idp/conf/attribute-filter.xml に開示する属性を追記. 参考) https://meatwiki.nii.ac.jp/confluence/pages/viewpage.action?pageId=20021644 -eduPersonPrincipalName -jaGivenName -jasn -mail で tomcat をリスタート