啟用 XML 簽名以簽署屬性查詢,如Java Fedlet 簽名和加密支援中所述。
將於先前步驟中產生的憑證增加到 Fedlet sp.xml 檔案中的 RoleDescriptor 元素中。在以下範例中,有兩個供您在其中貼上憑證的 KeyDescriptor 標記。一個用於簽名,另一個用於加密。如果不啟用加密,則不需要 KeyDescriptor use="encryption" 標記。
<RoleDescriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:query="urn:oasis:names:tc:SAML:metadata:ext:query"
xsi:type="query:AttributeQueryDescriptorType"
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>
--certificate--
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</KeyDescriptor>
<KeyDescriptor use="encryption">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>
--certificate--
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc">
<xenc:KeySize
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">128</xenc:KeySize>
</EncryptionMethod>
</KeyDescriptor>
</RoleDescriptor>
在 Java Fedlet sp-extended.xml 檔案中,指定 signingCertAlias 屬性的值,並指定 encryptionCertAlias 屬性 (如果已配置) 的值。
如果您計劃配置識別提供者以加密指定,也請加密 NameID 元素。因此,必須將 wantNameIDEncrypted 屬性的值設定為 true。將 XML 代碼增加到 AttributeQueryConfig 元素中。例如:
<Attribute name="signingCertAlias">
<Value>test</Value>
</Attribute>
<Attribute name="encryptionCertAlias">
<Value>test</Value>
</Attribute>
<Attribute name="wantNameIDEncrypted">
<Value>true</Value>
</Attribute>
在此範例中,test 是範例金鑰的別名。
將 Java Fedlet 中介資料檔案 (sp.xml) 匯入識別提供者。
此外,在識別提供者中執行其他配置步驟,以支援 Fedlet 屬性查詢。