Shibboleth IdP 3に関する情報をまとめているページです。
動作確認環境
OS | Java | Servlet | IdP |
---|
CentOS 6.5 | OpenJDK 7 (CentOS 6.5付属) | Apache Tomcat 7.0.62 | Shibboleth IdP 3.1.2 |
CentOS 6.5 | Oracle Java 8u45 + JCE Unlimited Strength Jurisdiction Policy Files | Apache Tomcat 8.0.23 | Shibboleth IdP 3.1.2 |
CentOS 6.5 | OpenJDK 7 (CentOS 6.5付属) | Apache Tomcat 7.0.62 | Shibboleth IdP 3.2.1 |
設定
メタデータ
学認メタデータ
学認メタデータの読み込みはconf/metadata-providers.xml
で設定します。
Shibboleth IdP 3.1の情報
学認メタデータの読み込みはconf/metadata-providers.xml で設定します。 |
ローカルSPメタデータ
ローカルSPのメタデータはmetadata
以下に配置して、conf/metadata-providers.xml
で設定します。
参考: 学内システムとして構築する場合の設定
認証
LDAPを用いたパスワード認証
Shibboleth IdP 3からは、LDAPモジュールを用いたJAASによるパスワード認証に加えて、直接LDAPを参照するパスワード認証が追加されました。
デフォルトは直接LDAPを参照するパスワード認証です。
直接LDAPを参照するパスワード認証
JAASによるパスワード認証
Shibboleth IdP 3.1.2で確認した内容です。 |
conf/authn/password-authn-config.xml
<import resource="jaas-authn-config.xml" />
の行をアンコメントして、<import resource="ldap-authn-config.xml" />
の行をコメントアウトします。
<!-- Choose an import based on the back-end you want to use. -->
<import resource="jaas-authn-config.xml" />
<!-- <import resource="krb5-authn-config.xml" /> -->
<!-- <import resource="ldap-authn-config.xml" /> --> |
conf/authn/jaas.config
参照するLDAPにあわせて、org.ldaptive.jaas.LdapLoginModule required以降の行を設定します。
ShibUserPassAuth {
/*
com.sun.security.auth.module.Krb5LoginModule required;
*/
org.ldaptive.jaas.LdapLoginModule required
ldapUrl="ldap://localhost"
baseDn="ou=people,dc=example,dc=ac,dc=jp"
ssl="false"
userFilter="uid={user}"
subtreeSearch="true"
;
}; |
高度な認証設定
Shibboleth IdP 3の高度な認証設定を参照してください。
NameID
NameID設定を参照してください。
eduPersonTargetedID 属性の送信
//saml2:Subject/saml2:NameID
とは別に//saml2:AttributeStatement/saml2:Attribute
[@FriendlyName="eduPersonTargetedID"]
としてeduPersonTargetedID
属性を送信する設定は下記の通りです。
なお、この機能はShibboleth IdP 3ではDeprecated Featuresとなっています。
computedId
computedIdでの設定を下記に示します。Shibboleth IdP 2と同じ設定で送信可能です。
conf/attribute-resolver.xml
のComputedIdConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/saml-nameid.propertiesの
プロパティを使って書くこともできます。
storedId
storedIdでの設定を下記に示します。Shibboleth IdP 2と同じ設定で送信可能です。
conf/attribute-resolver.xml
のStoredIdConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/global.xml
のbean MyDataSource
とconf/saml-nameid.propertiesのプ
ロパティを使って書くこともできます。
Attribute Query
SAML 2 persistent IDでのAttribute Queryの許可
この機能はcomputedIdを使っている場合は使用できません。まずstoredIdを使うように設定変更してください。 |
RelyingPartyの設定
SAML1でフロントチャネルにAttributeStatementを含める設定
画面のカスタマイズ
ロゴの変更
ロゴをデフォルトのOur Identity Providerから機関のロゴに変更する手順は下記の通りです。
ロゴファイル organization-logo.png
をedit-webapp/images/
以下に配置します。
$ ls edit-webapp/images/
dummylogo-mobile.png dummylogo.png organization-logo.png |
|
bin/build.sh
を実行して、war/idp.war
を作り直します。
$ sudo -u tomcat env JAVA_HOME="${JAVA_HOME}" bin/build.sh
Installation Directory: [/opt/shibboleth-idp]
Rebuilding /opt/shibboleth-idp/war/idp.war ...
...done
BUILD SUCCESSFUL
Total time: 16 seconds |
|
messages/error-messages.properties
のidp.logo
を上記1.で配置したファイル名に変更します。 なお、ファイル名は/images/
から始めます。また、 idp.logo.alt-text
を変更します。
# General strings
idp.title = Web Login Service
idp.title.suffix = Error
idp.logo = /images/organization-logo.png
idp.logo.alt-text = Organization logo |
# General strings
idp.title = Web Login Service
idp.title.suffix = Error
-idp.logo = /images/dummylogo.png
-idp.logo.alt-text = Replace or remove this logo
+idp.logo = /images/organization-logo.png
+idp.logo.alt-text = Organization logo |
|
メッセージの多言語化
日本語を含む英語以外のメッセージファイルは下記ページからダウンロードできます。
ダウンロードしたメッセージファイルをmessages
ディレクトリ配下にコピーすることで、ブラウザに表示されるメッセージを英語以外に変更できます。
上記URLで提供している日本語メッセージファイルについての注意点 - ボタンに表示するメッセージ(
idp.login.login )は、Password認証フローのExtendedフローを使用した際に他の認証と合わせてアルファベットが並ぶように「Login」と英語のままです。 - ユーザが存在しない場合のエラーメッセージ(
bad-username.message )とパスワードが間違った場合のエラーメッセージ(bad-password.message )は、どちらも「ユーザ名かパスワードが違います。」と同じメッセージです。(英語では、「The username you entered cannot be identified.」と「The password you entered was incorrect.」と異なります)
|
表示されるメッセージの優先順位は下記の通りです。
Accept-Language
ヘッダーの一番目に一致するmessage_言語_国.properties
Accept-Language
ヘッダーの一番目に一致するmessage_言語.properties
- Javaのシステムプロパティに一致する
message_言語_国.properties
- Javaのシステムプロパティに一致する
message_言語.properties
- デフォルトの
message.properties
Javaのシステムプロパティの優先順位は下記の通りです。
- コマンドラインオプション
user.language
とuser.country
- 環境変数
LC_MESSAGES
- 環境変数
LANG
ブラウザの使用言語によらずある言語を強制する方法は以下のページに説明があります。
https://wiki.shibboleth.net/confluence/display/IDP30/Switching+locale+on+the+login+page
多言語化の方法
表示するメッセージを英語から日本語などに変更する場合は、下記の3つのメッセージファイルを用意します。文字コードはUTF-8である必要があります。
messages/authn-messages_言語[_国].properties
messages/consent-messages_言語[_国].properties
messages/error-messages_言語[_国].properties
日本語の場合の例を下記に示します。
messages/authn-messages_ja.properties
messages/consent-messages_ja.properties
messages/error-messages_ja.properties
イギリス英語の例を下記に示します。
messages/authn-messages_en_GB.properties
messages/consent-messages_en_GB.properties
messages/error-messages_en_GB.properties
ユーザ同意機能
Shibboleth IdP 3には、uApprove相当のユーザ同意機能があります。uApprove JPとの違いはShibboleth IdP 3のユーザ同意機能とuApprove JPとの相違点を参照してください。
ユーザ同意の情報をMySQLに保存する設定
MySQL上にデータベース shibboleth が存在することを前提としております。また、MySQL Connector/J (mysql-connector-java-5.1.xx-bin.jar)をインストールしておいてください。 |
StorageRecordsテーブルの作成
StorageRecordsテーブルを作成します。
CREATE TABLE `StorageRecords` (
`context` varchar(255) NOT NULL,
`id` varchar(255) NOT NULL,
`expires` bigint(20) DEFAULT NULL,
`value` longtext NOT NULL,
`version` bigint(20) NOT NULL,
PRIMARY KEY (`context`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
|
conf/global.xml
shibboleth.JPAStorageServiceを定義します。persistent-idの設定(storedId)が設定済みの場合、最後のMyDataSourceの定義は重複となるため不要です。
<!-- Use this file to define any custom beans needed globally. -->
<bean id="shibboleth.JPAStorageService"
class="org.opensaml.storage.impl.JPAStorageService"
p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"
c:factory-ref="shibboleth.JPAStorageService.entityManagerFactory" />
<bean id="shibboleth.JPAStorageService.entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="packagesToScan" value="org.opensaml.storage.impl" />
<property name="dataSource" ref="MyDataSource" />
<property name="jpaVendorAdapter" ref="shibboleth.JPAStorageService.JPAVendorAdapter" />
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
</property>
</bean>
<bean id="shibboleth.JPAStorageService.JPAVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" />
<!-- A DataSource bean suitable for use in the idp.persistentId.dataSource property. -->
<bean id="MyDataSource"
class="org.apache.tomcat.dbcp.dbcp.BasicDataSource"
p:driverClassName="com.mysql.jdbc.Driver"
p:url="jdbc:mysql://localhost:3306/shibboleth"
p:username="username"
p:password="password"
p:maxActive="10"
p:maxIdle="5"
p:maxWait="15000"
p:testOnBorrow="true"
p:validationQuery="select 1"
p:validationQueryTimeout="5" /> |
|
conf/idp.properties
idp.consent.StorageService
をconf/global.xml
で定義したshibboleth.JPAStorageService
に変更します。
# Set to "shibboleth.StorageService" or custom bean for alternate storage of consent
idp.consent.StorageService = shibboleth.JPAStorageService |
# Set to "shibboleth.StorageService" or custom bean for alternate storage of consent
-#idp.consent.StorageService = shibboleth.ClientPersistentStorageService
+idp.consent.StorageService = shibboleth.JPAStorageService |
|
Shibboleth IdP 3.1の情報
属性毎に同意を得る設定
SPの必須属性にもチェックボックスが表示されるため、利用者がSPの必須属性のチェックを外して属性を送信しなかった場合にSPを利用できない可能性があります。 |
送信済み属性の属性値が変化した場合に再同意を得る設定
同意機能の無効化設定
ログレベルの変更
Shibboleth IdP 3.2からの新機能です。 |
Shibboleth IdP 3.2より、ログレベルの変更がconf/idp.properties
で行えるようになりました。
アクセス制限(Shibboleth IdP 2のFPSP機能)
Shibboleth IdP 2におけるFPSPによるアクセス制御を行うには、GakuNinShibInstall > 技術ガイド > 実習セミナー > Shibboleth環境構築セミナー(活用編) > Shibboleth IdPによるアクセス制限を参照してください。
クラスタリング
Shibboleth IdP 3においてクラスタリングを行うには、クラスタリング設定を参照してください。
子ページ
参考