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>

ローカルSPメタデータ

T.B.D.

認証

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

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

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

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

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

高度な認証設定

Shibboleth IdP 3の高度な認証設定を参照してください。

//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のデフォルトはCryptoTransientIdに変更になりました。CryptoTransientIdの使用例を下記に示します。

<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> 

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

StoredTransientIdの使用例を下記に示します。

<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.xmlresolver:AttributeDefinitionで定義して、idp.persistentId.sourceAttributeで指定した属性がLDAPで定義されているのみでconf/attribute-resolver.xmlresolver:AttributeDefinitionで定義されていない場合は、PersistentIdGeneratorから参照できませんので以下のように定義し、conf/attribute-filter.xmlで送信設定を行います。他の用途に使用しない場合resolver:AttributeEncoderの2行は不要です。

    <!-- ========================================== -->
    <!--      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>

storedId

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

Shibboleth IdP 3.1の情報
  • 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, idp.persistentId.storeidp.persistentId.sourceAttributeidp.persistentId.saltを設定します。

    # Set to shibboleth.StoredPersistentIdGenerator for db-backed storage
    # and uncomment/name the PersistentIdStore bean to use
    idp.persistentId.generator = shibboleth.StoredPersistentIdGenerator
    idp.persistentId.store = PersistentIdStore
    # Set this to null to skip hash-based generation of first stored ID
    #idp.persistentId.computed = shibboleth.ComputedPersistentIdGenerator
    
    # Otherwise for computed PersistentIDs set the source attribute and salt.
    idp.persistentId.sourceAttribute = uid4persistentId
    idp.persistentId.salt = changethistosomethingrandom
  • conf/global.xml
    idp.persistentId.storeの値をconf/global.xmlで定義します。

    <!-- Use this file to define any custom beans needed globally. -->
    <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" />
    
    <bean id="PersistentIdStore"
          class="net.shibboleth.idp.saml.nameid.impl.JDBCPersistentIdStore"
          p:dataSource-ref="MyDataSource" />
    <!-- Use this file to define any custom beans needed globally. -->
    <bean id="MyDataSource"
          class="org.apache.tomcat.dbcp.dbcp2.BasicDataSource"
          p:driverClassName="com.mysql.jdbc.Driver"
          p:url="jdbc:mysql://localhost:3306/shibboleth"
          p:username="username"
          p:password="password"
          p:maxIdle="5"
          p:maxTotal="10"
          p:maxWaitMillis="15000"
          p:testOnBorrow="true"
          p:validationQuery="select 1"
          p:validationQueryTimeout="5" />
    
    <bean id="PersistentIdStore"
          class="net.shibboleth.idp.saml.nameid.impl.JDBCPersistentIdStore"
          p:dataSource-ref="MyDataSource" />

    Tomcat 8付属のDBCP2から、p:maxActivep:maxTotalに、p:maxWaitp:maxWaitMillisに変更になりました。

  • conf/attribute-resolver.xmlとconf/attribute-filter.xml
    idp.persistentId.sourceAttributeの値をconf/attribute-resolver.xmlresolver:AttributeDefinitionで定義して、idp.persistentId.sourceAttributeで指定した属性がLDAPで定義されているのみでconf/attribute-resolver.xmlresolver:AttributeDefinitionで定義されていない場合は、PersistentIdGeneratorから参照できませんので以下のように定義し、conf/attribute-filter.xmlで送信設定を行います。他の用途に使用しない場合resolver:AttributeEncoderの2行は不要です

    <!-- ========================================== -->
    <!--      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>

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 MyDataSourceconf/saml-nameid.propertiesのプロパティを使って書くこともできます。

Attribute Query

SAML 2 persistent IDでのAttribute Queryの許可

この機能はcomputedIdを使っている場合は使用できません。まずstoredIdを使うように設定変更してください。

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

ロゴの変更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.1時点の情報

表示するメッセージを英語から日本語などに変更する場合は、下記の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.1時点の情報

属性毎に同意を得る設定3.1時点の情報

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

ログレベルの変更3.2

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

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

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

クラスタリング

Shibboleth IdP 3においてクラスタリングを行うには、クラスタリング設定を参照してください。

子ページ

参考