Shibboleth Identity Provider 2.4.0以降
/usr/java/tomcat
)/opt/shibboleth-idp
)/opt/shibboleth-identityprovider-#version#
)sptou-plagin-#version#-bin.zip
を展開したディレクトリ (例: /tmp/sptou-plagin-#version#
)設定ファイルを Shibboleth IdP の${IDP_HOME}/conf
ディレクトリにコピーしてください:
# mkdir ${IDP_HOME}/conf/SPToU # cp ${SPTOU_INSTALL}/configuration/* ${IDP_HOME}/conf/SPToU/ |
ライブラリを Shibboleth IdP の${IDP_INSTALL}/lib
にコピーしてください:
# cp ${SPTOU_INSTALL}/lib/* ${IDP_INSTALL}/lib/ |
webapp ディレクトリの Web アプリケーションファイルを Shibboleth IdP の${IDP_INSTALL}/webapp
ディレクトリにインストールしてください:
# cd ${SPTOU_INSTALL} # ant install -Didp.install=${IDP_INSTALL} |
以下のデータベースパラメータは一例です。実際の値は必要に応じて変更してください。特にパスワードは安全なものを用意してください。 |
ユーザ名 sptou, パスワード sptou でデータベースのユーザを作成します。
このユーザに INSERT, SELECT, UPDATE, DELETE 権限を与えます。
以下のスキーマ定義をつかってテーブルを作成します。
${SPTOU_INSTALL}/storage/sptou-schema.sql
${IDP_INSTALL}/src/main/webapp/WEB-INF/web.xml
を編集します:
<web-app ...> <context-param> <param-name>contextConfigLocation</param-name> <param-value>$IDP_HOME$/conf/internal.xml; $IDP_HOME$/conf/service.xml; $IDP_HOME$/conf/SPToU/sptou-plugin.xml;</param-value> </context-param> <!-- Other Filters ... --> <!-- (GakuNin) SP Terms of Use --> <filter> <filter-name>SPToUFilter</filter-name> <filter-class>jp.gakunin.shibboleth.idpplugin.sptou.SPToUFilter</filter-class> </filter> <filter-mapping> <filter-name>SPToUFilter</filter-name> <url-pattern>/profile/Shibboleth/SSO</url-pattern> <url-pattern>/profile/SAML2/Redirect/SSO</url-pattern> </filter-mapping> <!-- Other Servlets ... --> <!-- (GakuNin) SP Terms of Use --> <servlet> <servlet-name>SPToUServlet</servlet-name> <servlet-class>jp.gakunin.shibboleth.idpplugin.sptou.SPToUServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SPToUServlet</servlet-name> <url-pattern>/SPToU/SPToUServlet</url-pattern> </servlet-mapping> <!-- Others ... --> </web-app> |
|
uApprove.jpと併用する場合は、uApprove.jpの 変更前:
変更後:
|
idp.war
のデプロイプラグインを有効にするため、idp.war
を再デプロイします:
# cd ${IDP_INSTALL} # ./install.sh |
idp.war
を${CATALINA_HOME}/webapps
にコピーします:
# cp ${IDP_HOME}/war/idp.war $CATALINA_HOME/webapps/ |
${IDP_HOME}/conf/SPToU/sptou-plugin.xml
context:property-placeholder
location
の値を設定します:
変更前:
<context:property-placeholder location="file://$IDP_HOME$/conf/SPToU/sptou.properties" /> |
変更後:
<context:property-placeholder location="file:///opt/shibboleth-idp/conf/SPToU/sptou.properties" /> |
SPToUMapping
propertyfile
の値を設定します:
変更前:
<bean id="SPToUMapping" class="jp.gakunin.shibboleth.idpplugin.sptou.SPToUMapping" init-method="initialize"> <property name="propertyfile"> <value>$IDP_HOME$/conf/SPToU/sptoumapping.properties</value> </property> </bean> |
変更後:
<bean id="SPToUMapping" class="jp.gakunin.shibboleth.idpplugin.sptou.SPToUMapping" init-method="initialize"> <property name="propertyfile"> <value>/opt/shibboleth-idp/conf/SPToU/sptoumapping.properties</value> </property> </bean> |
AcceptanceStorage
sqlStatements
の値を設定します:
変更前:
<bean id="AcceptanceStorage" class="jp.gakunin.shibboleth.idpplugin.sptou.StorageImpl" init-method="initialize" p:dataSource-ref="gakunin.dataSource"> <property name="sqlStatements"> <value>$IDP_HOME$/conf/SPToU/sql-statements.properties</value> </property> </bean> |
変更後:
<bean id="AcceptanceStorage" class="jp.gakunin.shibboleth.idpplugin.sptou.StorageImpl" init-method="initialize" p:dataSource-ref="gakunin.dataSource"> <property name="sqlStatements"> <value>/opt/shibboleth-idp/conf/SPToU/sql-statements.properties</value> </property> </bean> |
${IDP_HOME}/conf/SPToU/sptou.properties
あなたのデータベース環境に合せて、${IDP_HOME}/conf/SPToU/sptou.properties
のプロパティを修正します:
database.driver = com.mysql.jdbc.Driver database.url = jdbc:mysql://localhost:3306/sptou?characterEncoding=utf8 database.username = sptou database.password = sptou |
${IDP_HOME}/conf/SPToU/sptoumapping.properties
SP のエンティティID(sp.N.entityID
)とSPの利用条件定義ファイル(sp.N.ToU
)を関連づけて定義します:
sp.1.entityID=https://sp1.example.ac.jp/shibboleth sp.1.ToU=/opt/shibboleth-idp/conf/SPToU/tou-example.ac.jp.xml sp.2.entityID=https://sp2.example.ac.jp/shibboleth sp.2.ToU=/opt/shibboleth-idp/conf/SPToU/tou-example.ac.jp.xml sp.3.entityID=https://sp.example2.co.jp/shibboleth sp.3.ToU=/opt/shibboleth-idp/conf/SPToU/tou-example2.co.jp.xml sp.5.entityID=https://sp.example.com/shibboleth sp.5.ToU=/opt/shibboleth-idp/conf/SPToU/tou-example.com.xml |
|
|
利用条件はXML形式で定義します:
<?xml version="1.0" encoding="UTF-8"?> <TermsOfUse> <version>1.0</version> <text><![CDATA[Example Service Terms of use (ToU) version 1.0 This is an empty template for the sptou-example.xml version. Please adjust it according to the terms of use. ]]></text> </TermsOfUse> |
Tomcatを再起動します:
# service tomcat6 restart |
ログを出力するには、Shibboleth IdPの${IDP_HOME
}/conf/logging.xmlで設定します:
<logger name="jp.gakunin.shibboleth.idpplugin.sptou" level="WARN"/> |