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 |
設定
学認メタデータの読み込み
学認メタデータの読み込みはconf/metadata-providers.xml
で設定します。
conf/metadata-providers.xml
認証
LDAPを用いたパスワード認証
Shibboleth IdP 3からは、LDAPモジュールを用いたJAASによるパスワード認証に加えて、直接LDAPを参照するパスワード認証が追加されました。
デフォルトは直接LDAPを参照するパスワード認証です。
直接LDAPを参照するパスワード認証
conf/ldap.properties
参照するLDAPにあわせて、Connection properties, SSL configuration, Search DN resolutionのプロパティを設定します。
JAASによるパスワード認証
conf/authn/password-authn-config.xml
<import resource="jaas-authn-config.xml" />の行をアンコメントとして、<import resource="ldap-authn-config.xml" />の行をコメントアウトします。
conf/authn/jaas.config
参照するLDAPにあわせて、
org.ldaptive.jaas.LdapLoginModule required以降の行を設定します。
//saml2:Subject/saml2:NameID
//saml2:Subject/saml2:NameID
はconf/attribute-filter.xml
に記述しなくてもconf/saml-nameid.properties
とconf/saml-nameid.xml
の設定により、SPメタデータの<NameIDFormat>に従って
下記の通り送信します。
SPメタデータの<NameIDFormat> の値 | 送信する属性 |
---|---|
urn:oasis:names:tc:SAML:2.0:nameid-format:transient | transient-id |
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent | persistent-id |
<NameIDFormat> がない |
|
SPメタデータに複数の<NameIDFormat>がある場合は、SPメタデータの並び順で送信可能な属性を送信します。persistent-idの設定を行っていないなど送信可能な属性がない場合は、//saml2:Subject/saml2:NameID自体が送信されません。
<NameIDFormat>
がないSPの場合と<NameIDFormat>がurn:oasis:names:tc:SAML:2.0:nameid-format:persistent
の場合の//saml2:Subject/saml2:NameID
の例を下記に示す。
<NameIDFormat>
がないSPの場合<saml2:Subject> <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://idp.example.ac.jp/idp/shibboleth" SPNameQualifier="https://sp1.example.jp/shibboleth-sp">AAdzZWNyZXQxgUnobM3/AN3fn8DfZPDqBp/GnKNxc5JR4nxXAxDAXZZSg0AZSrDh1Sip1fl9JGYrm2NWjl8zHKxHmbsgS/mFZ1ZlSYQ2U/Kz7tCQ+SDswixwLRcGg3tDvVSAY8imKSrElGWSm5gMM45D4rkeQONJYr7gQZ13</saml2:NameID>
<NameIDFormat>が
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
の場合<saml2:Subject> <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" NameQualifier="https://idp.example.ac.jp/idp/shibboleth" SPNameQualifier="https://sp2.example.jp/shibboleth-sp">oiUiApwGnBP8pS3HZJ02ZW/aOTI=</saml2:NameID>
transient-idの設定
transient-id
のデフォルトはCryptoTransient
に変更になりました。CryptoTransient
の使用例を下記に示します。
IdP 2系と同じ短いTransient
を使いたい場合は下記の変更を行います。
conf/saml-nameid.properties
idp.transientId.generator
をアンコメントして、値をshibboleth.StoredTransientIdGenerator
に変更します。
Transient
の使用例を下記に示します。
<saml2:Subject> <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://idp.example.ac.jp/idp/shibboleth" SPNameQualifier="https://sp1.example.jp/shibboleth-sp">_f358fb015b9b45c7d18a4a2647e79c33</saml2:NameID>
persistent-idの設定
computedId
computedIdでの設定を下記に示します。
conf/saml-nameid.xml
<ref bean="shibboleth.SAML2PersistentGenerator" />
をアンコメントして有効にします。conf/saml-nameid.properties
idp.persistentId.generator
のデフォルトはComputedId
の設定のため、idp.persistentId.sourceAttribute
とidp.persistentId.salt
のみを設定します。conf/attribute-resolver.xml
とconf/attribute-filter.xml
idp.persistentId.sourceAttribute
の値をconf/attribute-resolver.xml
の//resolver:AttributeDefinition
で定義して、conf/attribute-filter.xml
で送信設定を行います。conf/intercept/consent-intercept-config.xml
ユーザ同意画面にて%{idp.persistentId.sourceAttribute}
を表示しないように、//util:list[@id="shibboleth.consent.attribute-release.BlacklistedAttributeIDs"]
に%{idp.persistentId.sourceAttribute}
を追加します。
storedId
storedIdでの設定を下記に示します。
conf/saml-nameid.xml
<ref bean="shibboleth.SAML2PersistentGenerator" />
をアンコメントして有効にします。conf/saml-nameid.properties
idp.persistentId.generator,
idp.persistentId.store, idp.persistentId.sourceAttributeとidp.persistentId.salt
を設定します。conf/global.xml
idp.persistentId.storeの値をconf/global.xml
で定義します。Tomcat 8の場合に、
p:maxActive
およびp:maxWait
を指定するとエラーとなり、Shibboleth IdPが起動しない。conf/attribute-resolver.xml
とconf/attribute-filter.xml
idp.persistentId.sourceAttribute
の値をconf/attribute-resolver.xml
の//resolver:AttributeDefinition
で定義して、conf/attribute-filter.xml
で送信設定を行います。conf/intercept/consent-intercept-config.xml
ユーザ同意画面にて%{idp.persistentId.sourceAttribute}
を表示しないように、//util:list[@id="shibboleth.consent.attribute-release.BlacklistedAttributeIDs"]
に%{idp.persistentId.sourceAttribute}
を追加します。
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
conf/attribute-filter.xml
conf/attribute-resolver.xml
のData ConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/saml-nameid.propertiesの
プロパティを使って書くこともできます。
conf/attribute-resolver.xml
Shibboleth IdP 3.1.2では、
salt
属性は%{idp.persistentId.salt}
で置き換えられませんので、ご注意ください。[IDP-771]
storedId
storedIdでの設定を下記に示します。Shibboleth IdP 2と同じ設定で送信可能です。
conf/attribute-resolver.xml
conf/attribute-filter.xml
conf/attribute-resolver.xml
のData ConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/global.xmlの
beanとconf/saml-nameid.propertiesのプ
ロパティを使って書くこともできます。
conf/attribute-resolver.xml
Shibboleth IdP 3.1.2では、
salt
属性は%{idp.persistentId.salt}
で置き換えられませんので、ご注意ください。[IDP-771]
Attribute Query
SAML 2 persistent IDでのAttribute Queryの許可
conf/c14n/subject-c14n.xml
conf/c14n/subject-c14n.xml
の<ref bean="c14n/SAML2Persistent" />
をアンコメントします。
画面のカスタマイズ
ロゴの変更
ロゴをデフォルトのOur Identity Providerから機関のロゴに変更する手順は下記の通りです。
ロゴファイル
organization-logo.png
をedit-webapp/images/
以下に配置します。$ ls edit-webapp/images/ dummylogo-mobile.png dummylogo.png organization-logo.png
messages/error-messages.properties
のidp.logo
を上記1.で配置したファイル名に変更します。 なお、ファイル名は/images/
から始めます。また、idp.logo.alt-text
を変更します。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
メッセージの多言語化
表示するメッセージを英語から日本語などに変更する場合は、下記の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
表示されるメッセージの優先順位は下記の通りです。
Accept-Language
ヘッダーの一番目に一致するmessage_言語_国.properties
Accept-Language
ヘッダーの一番目に一致するmessage_言語.properties
- Javaのシステムプロパティに一致する
message_言語_国.properties
- Javaのシステムプロパティに一致する
message_言語.properties
- デフォルトの
message.properties
Javaのシステムプロパティの優先順位は下記の通りです。
- コマンドラインオプション
user.language
とuser.country
- 環境変数
LC_MESSAGES
- 環境変数
LANG
ユーザ同意機能
Shibboleth IdP 3には、uApprove相当のユーザ同意機能があります。uApprove JPとの違いはShibboleth IdP 3のユーザ同意機能とuApprove JPとの相違点を参照ください。
ユーザ同意の情報をMySQLに保存する設定
StorageRecordsテーブルの作成
conf/global.xml
persistent-idの設定で定義した
shibboleth.MySQLDataSource
を参照する形でshibboleth.JPAStorageService
を定義します。persistent-idの設定を設定していない場合は合わせて設定を行ってください。conf/idp.properties
属性毎に同意を得る設定
conf/idp.properties
idp.consent.allowPerAttribute
をtrue
に設定することで、属性毎にチェックボックスを付加することができます。SPの必須属性にもチェックボックスが表示されるため、利用者がSPの必須属性のチェックを外して属性を送信しなかった場合にSPの利用できない可能性があります。
送信済み属性の属性値が変化した場合に再同意を得る設定
conf/idp.properties
アクセス制限(Shibboleth IdP 2のFPSP機能)
Shibboleth IdP 2においてFPSPによるアクセス制御を行うには、GakuNinShibInstall > 技術ガイド > 実習セミナー > Shibboleth環境構築セミナー(活用編) > Shibboleth IdPによるアクセス制限をご参照ください。
参考
- [Shibboleth wiki] Identity Provider 3
- [Shibboleth wiki] IdP 3 / ReleaseNotes
- [SWITCH] Shibboleth Identity Provider (IdP) 3 Installation Guide
- [SWITCH] Shibboleth IdPv3: Considerations in the Context of SWITCHaai
- 3.1 Operating Systems: Linux long-term support (Ubuntu Server 14.04 LTS / Red Hat Enterprise Linux 7 / CentOS 7)
- 3.2 Java & Servlet Container: OpenJDK 7, Apache Tomcat 7 & Apache HTTP Server 2.4
- 3.3 Database for persistentIDs and user consent: PostgreSQL
- 3.4 IdP Session Storage: Client Session Storage with Cookies
- [upki-fed:00880] Re: Shibboleth IdP 3.0 リリース
- シボレス実習活用編
- 学認技術ガイド > IdP構築後のカスタマイズ 内「IdPアップデート手順」