...
コード ブロック | ||
---|---|---|
| ||
<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系と同じ短いTransientId
transient-id
を使いたい場合は下記の変更を行います。
conf/saml-nameid.properties
idp.transientId.generator
をアンコメントして、値をshibboleth.StoredTransientIdGenerator
に変更します。展開 コード ブロック language java title conf/saml-nameid.properties # Set to shibboleth.StoredTransientIdGenerator for server-side transient ID storage idp.transientId.generator = shibboleth.StoredTransientIdGenerator
コード ブロック language diff title 差分 # Set to shibboleth.StoredTransientIdGenerator for server-side transient ID storage -#idp.transientId.generator = shibboleth.CryptoTransientIdGenerator +idp.transientId.generator = shibboleth.StoredTransientIdGenerator
...
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" /> <!-- -->
コード ブロック language diff title 差分 <!-- Uncommenting this bean requires configuration in saml-nameid.properties. --> - <!-- + <!-- --> <ref bean="shibboleth.SAML2PersistentGenerator" /> - --> + <!-- -->
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 = PersistentIdDataSource # 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 # For advanced use, set to a bean inherited from shibboleth.JDBCPersistentIdStore -#idp.persistentId.store = MyPersistentIdStore +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
conf/attribute-resolver.xml
のidp.persistentId.sourceAttribute
で指定したresolver:AttributeDefinitionをコメントアウトします
。AttributeDefinition
をコメントアウトします。展開 コード ブロック 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> + <!--
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
を定義します。展開 コード ブロック 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" />
conf/saml-nameid.xml
conf/saml-nameid.xm
lで、idp.persistentId.store
で指定したbeanMyPersistentIdStore
を定義します。展開 コード ブロック language xml title conf/saml-nameid.xml <!-- ========================= SAML NameID Generation ========================= --> <!-- A "store" bean suitable for use in the idp.persistentId.store property. --> <bean id="MyPersistentIdStore" parent="shibboleth.JDBCPersistentIdStore" p:dataSource-ref="MyDataSource" p:queryTimeout="PT2S" p:retryableErrors="#{{'23000'}}" />
コード ブロック language diff title 差分 <!-- ========================= SAML NameID Generation ========================= --> + <!-- A "store" bean suitable for use in the idp.persistentId.store property. --> + <bean id="MyPersistentIdStore" parent="shibboleth.JDBCPersistentIdStore" + p:dataSource-ref="MyDataSource" + p:queryTimeout="PT2S" + p:retryableErrors="#{{'23000'}}" />
...