Shibboleth IdP 3に関する情報をまとめているページです。

Shibboleth IdP 3.2に関する情報に更新中です。

動作確認環境

OSJavaServletIdP
CentOS 6.5OpenJDK 7 (CentOS 6.5付属)Apache Tomcat 7.0.62Shibboleth IdP 3.1.2
CentOS 6.5Oracle Java 8u45 + JCE Unlimited Strength Jurisdiction Policy FilesApache Tomcat 8.0.23Shibboleth IdP 3.1.2
CentOS 6.5OpenJDK 7 (CentOS 6.5付属)Apache Tomcat 7.0.62Shibboleth IdP 3.2.1

設定

学認メタデータの読み込み

学認メタデータの読み込みはconf/metadata-providers.xmlで設定します。

Shibboleth IdP 3.1の情報

学認メタデータの読み込みはconf/metadata-providers.xmlで設定します。

  • conf/metadata-providers.xml

    <MetadataProvider id="HTTPMetadata"
                      xsi:type="FileBackedHTTPMetadataProvider"
                      backingFile="%{idp.home}/metadata/gakunin-metadata-backing.xml"
                      metadataURL="https://metadata.gakunin.nii.ac.jp/gakunin-metadata.xml">
    
        <MetadataFilter xsi:type="RequiredValidUntil" maxValidityInterval="P15D" />
        <MetadataFilter xsi:type="SignatureValidation"
                        requireSignedMetadata="true"
                        certificateFile="%{idp.home}/credentials/gakunin-signer-2010.cer"/>
        <MetadataFilter xsi:type="EntityRoleWhiteList">
            <RetainedRole>md:SPSSODescriptor</RetainedRole>
        </MetadataFilter>
    
    </MetadataProvider>

認証

LDAPを用いたパスワード認証

Shibboleth IdP 3からは、LDAPモジュールを用いたJAASによるパスワード認証に加えて、直接LDAPを参照するパスワード認証が追加されました。

デフォルトは直接LDAPを参照するパスワード認証です。

直接LDAPを参照するパスワード認証

JAASによるパスワード認証3.1時点の情報

//saml2:Subject/saml2:NameID

//saml2:Subject/saml2:NameIDconf/attribute-filter.xmlに記述しなくてもconf/saml-nameid.propertiesconf/saml-nameid.xmlの設定により、SPメタデータの<NameIDFormat>に従って下記の通り送信します。

SPメタデータの<NameIDFormat>の値送信する属性
urn:oasis:names:tc:SAML:2.0:nameid-format:transienttransient-id
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent

persistent-id

<NameIDFormat>がない

saml-nameid.propertiesidp.nameid.saml2.defaultに従う。

デフォルトはurn:oasis:names:tc:SAML:2.0:nameid-format:transient

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の例を下記に示す。

transient-idの設定

transient-idのデフォルトはCryptoTransientに変更になりました。CryptoTransientの使用例を下記に示します。

IdP 2系と同じ短いTransientを使いたい場合は下記の変更を行います。

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での設定を下記に示します。

Shibboleth IdP 3.1の情報

computedIdでの設定を下記に示します。

  • conf/saml-nameid.xml
    <ref bean="shibboleth.SAML2PersistentGenerator" /> をアンコメントして有効にします。

    <!-- Uncommenting this bean requires configuration in saml-nameid.properties. -->
    <!-- -->
    <ref bean="shibboleth.SAML2PersistentGenerator" />
    <!-- -->
  • conf/saml-nameid.properties
    idp.persistentId.generatorのデフォルトはComputedIdの設定のため、idp.persistentId.sourceAttributeidp.persistentId.saltのみを設定します。

    # Set to shibboleth.StoredPersistentIdGenerator for db-backed storage
    # and uncomment/name the PersistentIdStore bean to use
    #idp.persistentId.generator = shibboleth.ComputedPersistentIdGenerator
    
    # Otherwise for computed PersistentIDs set the source attribute and salt.
    idp.persistentId.sourceAttribute = uid4persistentId
    idp.persistentId.salt = changethistosomethingrandom
  • conf/attribute-resolver.xmlconf/attribute-filter.xml
    idp.persistentId.sourceAttributeの値をconf/attribute-resolver.xml//resolver:AttributeDefinitionで定義して、conf/attribute-filter.xmlで送信設定を行います。

    <!-- ========================================== -->
    <!--      PersistentId Definition               -->
    <!-- ========================================== -->
    
    <!-- Attribute Definition for %{idp.persistentId.sourceAttribute} -->
    <resolver:AttributeDefinition id="%{idp.persistentId.sourceAttribute}" xsi:type="ad:Simple"
        sourceAttributeID="uid">
        <resolver:Dependency ref="myLDAP" />
    </resolver:AttributeDefinition>
    <!--  Release to anyone -->
    <afp:AttributeFilterPolicy id="PolicyforAnyone">
        <afp:PolicyRequirementRule xsi:type="basic:ANY" />
    
        <afp:AttributeRule attributeID="%{idp.persistentId.sourceAttribute}">
            <afp:PermitValueRule xsi:type="basic:ANY" />
        </afp:AttributeRule>
    
    </afp:AttributeFilterPolicy>
  • conf/intercept/consent-intercept-config.xml
    ユーザ同意画面にて%{idp.persistentId.sourceAttribute}を表示しないように、//util:list[@id="shibboleth.consent.attribute-release.BlacklistedAttributeIDs"]%{idp.persistentId.sourceAttribute}を追加します。

    <util:list id="shibboleth.consent.attribute-release.BlacklistedAttributeIDs">
        <value>transientId</value>
        <value>persistentId</value>
        <value>eduPersonTargetedID</value>
        <value>%{idp.persistentId.sourceAttribute}</value>
    </util:list>

storedId3.1時点の情報

IdP 3.1.2までのstoredIdにはrace conditionの問題があり、 IdP 3.2.0からstoredid周りに大きな変更が入ります。

storedIdでの設定を下記に示します。

eduPersonTargetedId 属性の送信3.1時点の情報

//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のData ConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/saml-nameid.propertiesのプロパティを使って書くこともできます。

storedId

storedIdでの設定を下記に示します。Shibboleth IdP 2と同じ設定で送信可能です。

conf/attribute-resolver.xmlのData ConnectorはShibboleth IdP 3の機能を用いて、persistent-idの設定で定義したconf/global.xmlのbeanとconf/saml-nameid.propertiesのプロパティを使って書くこともできます。

Attribute Query3.1時点の情報

SAML 2 persistent IDでのAttribute Queryの許可

画面のカスタマイズ3.1時点の情報

ロゴの変更

ロゴをデフォルトのOur Identity Providerから機関のロゴに変更する手順は下記の通りです。

  1. ロゴファイル organization-logo.pngedit-webapp/images/以下に配置します。 

    $ ls edit-webapp/images/
    dummylogo-mobile.png  dummylogo.png  organization-logo.png
  2. messages/error-messages.propertiesidp.logoを上記1.で配置したファイル名に変更します。 なお、ファイル名は/images/から始めます。また、 idp.logo.alt-textを変更します。

    idp.logo = /images/organization-logo.png
    idp.logo.alt-text = Organization logo
  3. 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である必要があります。

日本語の場合の例を下記に示します。

イギリス英語の例を下記に示します。

表示されるメッセージの優先順位は下記の通りです。

  1. Accept-Languageヘッダーの一番目に一致するmessage_言語_国.properties
  2. Accept-Languageヘッダーの一番目に一致するmessage_言語.properties
  3. Javaのシステムプロパティに一致するmessage_言語_国.properties
  4. Javaのシステムプロパティに一致するmessage_言語.properties
  5. デフォルトのmessage.properties

Javaのシステムプロパティの優先順位は下記の通りです。

  1. コマンドラインオプション user.languageuser.country
  2. 環境変数 LC_MESSAGES
  3. 環境変数 LANG

ユーザ同意機能3.1時点の情報

Shibboleth IdP 3には、uApprove相当のユーザ同意機能があります。uApprove JPとの違いはShibboleth IdP 3のユーザ同意機能とuApprove JPとの相違点を参照ください。

ユーザ同意の情報をMySQLに保存する設定

属性毎に同意を得る設定

送信済み属性の属性値が変化した場合に再同意を得る設定

ログレベルの変更3.2

Shibboleth IdP 3.2より、ログレベルの変更がconf/idp.propertiesで行えるようになりました。

アクセス制限(Shibboleth IdP 2のFPSP機能)

Shibboleth IdP 2においてFPSPによるアクセス制御を行うには、GakuNinShibInstall > 技術ガイド > 実習セミナー > Shibboleth環境構築セミナー(活用編) > Shibboleth IdPによるアクセス制限をご参照ください。

子ページ

参考