このページの古いバージョンを表示しています。現在のバージョンを表示します。

現在のバージョンとの相違点 ページ履歴を表示

« 前のバージョン バージョン 24 次のバージョン »

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

動作確認環境

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

設定

//saml2:Subject/saml2:NameID

//saml2:Subject/saml2:NameIDattribute-filter.xmlに記述しなくてもsaml-nameid.propertiessaml-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

persistent-idの設定を行っていない場合は、//saml2:Subject/saml2:NameID自体が送信されません。

<NameIDFormat>がない

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

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

 

<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を使いたい場合は下記の変更を行います。

  • saml-nameid.properties

    idp.transientId.generatorをアンコメントして、値をshibboleth.StoredTransientIdGeneratorに変更します。

    saml-nameid.properties
    # Set to shibboleth.StoredTransientIdGenerator for server-side storage
    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での設定を下記に示します。

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

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

    saml-nameid.properties
    # 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
  • attribute-resolver.xmlattribute-filter.xml
    idp.persistentId.sourceAttributeの値をattribute-resolver.xml//resolver:AttributeDefinitionで定義して、attribute-filter.xmlで送信設定を行います。

    attribute-resolver.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>
    attribute-filter.xml
    <!--  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>

StoredId

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

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

    saml-nameid.xml
    <!-- Uncommenting this bean requires configuration in saml-nameid.properties. -->
    <!-- -->
    <ref bean="shibboleth.SAML2PersistentGenerator" />
    <!-- -->
  • saml-nameid.properties
    idp.persistentId.generator, idp.persistentId.store, idp.persistentId.sourceAttributeとidp.persistentId.saltを設定します。

    saml-nameid.properties
    # 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 = uid4ppersistentId
    idp.persistentId.salt = changethistosomethingrandom
  • global.xml
    idp.persistentId.storeの値をglobal.xmlの//beanで定義します。

    global.xml (Tomcat 7の場合)
    <!-- Use this file to define any custom beans needed globally. -->
    <bean id="shibboleth.MySQLDataSource"
        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="shibboleth.MySQLDataSource" />
    global.xml (Tomcat 8の場合)
    <!-- Use this file to define any custom beans needed globally. -->
    <bean id="shibboleth.MySQLDataSource"
        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:testOnBorrow="true"
        p:validationQuery="select 1"
        p:validationQueryTimeout="5" />
    <bean id="PersistentIdStore"
        class="net.shibboleth.idp.saml.nameid.impl.JDBCPersistentIdStore"
        p:dataSource-ref="shibboleth.MySQLDataSource" />

    Tomat 8の場合に、p:maxActiveおよびp:maxWaitを指定するとエラーとなり、Shibboleth IdPが起動しない。

  • attribute-resolver.xmlattribute-filter.xml
    idp.persistentId.sourceAttributeの値をattribute-resolver.xml//resolver:AttributeDefinitionで定義して、attribute-filter.xmlで送信設定を行います。

    attribute-resolver.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>
    attribute-filter.xml
    <!--  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>

参考

  • ラベルがありません