...
抜粋 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SPメタデータに複数の
transient-idの設定
IdP 2系と同じ短い
関連: [Shibboleth Wiki] Disable use of internal encryption key persistent-idの設定computedIdcomputedIdでの設定を下記に示します。
Shibboleth IdP 3.1の情報 展開 | computedIdでの設定を下記に示します。
コード ブロック | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Schema:
Core
schema attributes--> - <!--
+ <!-- --> <resolver:AttributeDefinition xsi:type="ad:Simple" id="uid" sourceAttributeID="uid"> <resolver:Dependency ref="myLDAP" /> <resolver:AttributeEncoder xsi:type="enc:SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oid:0.9.2342.19200300.100.1.1" friendlyName="uid" encodeType="false" /> </resolver:AttributeDefinition> + <!--
情報 他の用途に使用しない場合は
resolver:AttributeEncoder
の2行はコメントアウトしてかまいません。
Shibboleth IdP 3.1の情報
展開 | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
computedIdでの設定を下記に示します。
|
storedId
storedIdでの設定を下記に示します。
ヒント |
---|
MySQL上にデータベース |
conf/saml-nameid.xml
<ref bean="shibboleth.SAML2PersistentGenerator" />
をアンコメントして有効にします。展開 コード ブロック language xml title conf/
saml-nameid.xml <!-- Uncommenting this bean requires configuration in saml-nameid.properties. --> <!-- --> <ref bean="shibboleth.SAML2PersistentGenerator" />
storedId
storedIdでの設定を下記に示します。
ヒント |
---|
MySQL上にデータベース |
conf/saml-nameid.xml
<ref bean="shibboleth.SAML2PersistentGenerator" />
をアンコメントして有効にします。展開
<!-- -->
コード ブロック language xmldiff title 差分conf/saml-nameid.xml <!-- Uncommenting this bean requires configuration in saml-nameid.properties. --> - <!-- + <!-- --> <ref bean="shibboleth.SAML2PersistentGenerator" /> - --> + <!-- -->
ヒント 一部のSPにだけpersistent-idを送信したい場合、当該箇所をアンコメントせずに、以下を挿入すると対象SPを指定することができます。
コード ブロック language xml <bean parent="shibboleth.SAML2PersistentGenerator"> <!-- -->
コード ブロック language diff title 差分 <property name="activationCondition"> <!-- Uncommenting this bean requires configuration in saml-nameid.properties. --> - <bean <!-- + <!-- --> parent="shibboleth.Conditions.RelyingPartyId" c:candidates="#{{'https://test-sp1.gakunin.nii.ac.jp/shibboleth-sp', 'https://test-sp2.gakunin.nii.ac.jp/shibboleth-sp'}}" /> <ref bean="shibboleth.SAML2PersistentGenerator" /> - --> +</property> <!-- -->/bean>
conf/saml-nameid.properties
idp.persistentId.sourceAttribute,
idp.persistentId.salt, idp.persistentId.generatorとidp.persistentId.store
を設定します。idp.persistentId.salt
には他人が推測できないランダムな値を指定してください。古いIdPから設定を引き継ぐ場合は同じ値を指定してください。展開 コード ブロック language java title conf/saml-nameid.properties # Persistent IDs can be computed on the fly with a hash, or managed in a database # For computed IDs, set a source attribute and a secret salt: idp.persistentId.sourceAttribute = uid #idp.persistentId.useUnfilteredAttributes = true # Do *NOT* share the salt with other people, it's like divulging your private key. #idp.persistentId.algorithm = SHA idp.persistentId.salt = XXXXXXXXXXXXXXXXXXXXXXXXXXX # To use a database, use shibboleth.StoredPersistentIdGenerator idp.persistentId.generator = shibboleth.StoredPersistentIdGenerator # For basic use, set this to a JDBC DataSource bean name: idp.persistentId.dataSource = MyDataSource # For advanced use, set to a bean inherited from shibboleth.JDBCPersistentIdStore #idp.persistentId.store = MyPersistentIdStore # Set to an empty property to skip hash-based generation of first stored ID #idp.persistentId.computed = shibboleth.ComputedPersistentIdGenerator
コード ブロック language diff title 差分 # Persistent IDs can be computed on the fly with a hash, or managed in a database # For computed IDs, set a source attribute and a secret salt: -#idp.persistentId.sourceAttribute = changethistosomethingreal +idp.persistentId.sourceAttribute = uid #idp.persistentId.useUnfilteredAttributes = true # Do *NOT* share the salt with other people, it's like divulging your private key. #idp.persistentId.algorithm = SHA -#idp.persistentId.salt = changethistosomethingrandom +idp.persistentId.salt = XXXXXXXXXXXXXXXXXXXXXXXXXXX # To use a database, use shibboleth.StoredPersistentIdGenerator -#idp.persistentId.generator = shibboleth.ComputedPersistentIdGenerator +idp.persistentId.generator = shibboleth.StoredPersistentIdGenerator # For basic use, set this to a JDBC DataSource bean name: -#idp.persistentId.dataSource = PersistentIdDataSource +idp.persistentId.dataSource = MyDataSource # For advanced use, set to a bean inherited from shibboleth.JDBCPersistentIdStore #idp.persistentId.store = MyPersistentIdStore # Set to an empty property to skip hash-based generation of first stored ID #idp.persistentId.computed = shibboleth.ComputedPersistentIdGenerator
conf/attribute-resolver.xml
idp.persistentId.sourceAttribute
で指定した属性がLDAPで定義されているのみでconf/attribute-resolver.xml
の対応するresolver:AttributeDefinition
がコメントアウトされている場合、当該resolver:AttributeDefinition
をアンコメントします。(以下はsourceAttribute
としてuid
を指定した場合の例)展開 コード ブロック language xml title conf/attribute-resolver.xml <!-- Schema: Core schema attributes--> <!-- --> <resolver:AttributeDefinition xsi:type="ad:Simple" id="uid" sourceAttributeID="uid"> <resolver:Dependency ref="myLDAP" /> <resolver:AttributeEncoder xsi:type="enc:SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oid:0.9.2342.19200300.100.1.1" friendlyName="uid" encodeType="false" /> </resolver:AttributeDefinition> <!--
コード ブロック language diff title 差分 <!-- Schema: Core schema attributes--> - <!-- + <!-- --> <resolver:AttributeDefinition xsi:type="ad:Simple" id="uid" sourceAttributeID="uid"> <resolver:Dependency ref="myLDAP" /> <resolver:AttributeEncoder xsi:type="enc:SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oid:0.9.2342.19200300.100.1.1" friendlyName="uid" encodeType="false" /> </resolver:AttributeDefinition> + <!--
情報 他の用途に使用しない場合は
resolver:AttributeEncoder
の2行はコメントアウトしてかまいません。shibpidテーブルの作成
shibpidテーブルを作成します。展開 コード ブロック language sql title shibpid CREATE TABLE shibpid ( localEntity VARCHAR(255) NOT NULL, peerEntity VARCHAR(255) NOT NULL, persistentId VARCHAR(50) NOT NULL, principalName VARCHAR(50) NOT NULL, localId VARCHAR(50) NOT NULL, peerProvidedId VARCHAR(50) NULL, creationDate TIMESTAMP NOT NULL, deactivationDate TIMESTAMP NULL, PRIMARY KEY (localEntity, peerEntity, persistentId) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
conf/global.xml
conf/global.xml
でbeanMyDataSource
を定義します。ユーザ同意の情報をMySQLに保存する設定もしくはuApproveJP等で設定済みの場合、重複となるためこの定義は不要です。展開 コード ブロック language xml title conf/global.xml (Tomcat7の場合) <!-- Use this file to define any custom beans needed globally. --> <!-- 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" />
コード ブロック language diff title 差分 <!-- Use this file to define any custom beans needed globally. --> + <!-- 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" />
ヒント Tomcat8を使用している場合は、下記のShibbolethIdP3.1の情報を参考にしてください。
Shibboleth IdP 3.1の情報
展開 | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|