validate 操作の例

この ​validate​ 操作は、WSS 情報を含む受信 SOAP 要求を検証します。WSS Module は、要求を ​WssInboundConfig​ 設定に従って検証します。

Table 1. パラメーター
名前 M ES デフォルト値 説明

request

はい

いいえ

適用なし

TypedValue <InputStream>

SOAP 要求

version

いいえ

いいえ

SOAP_12

SoapVersion

SOAP プロトコルバージョン

出力は、受信した SOAP 要求と同じです。この操作は何も属性を返しません。

Table 2. Errors (エラー)
Namespace (名前空間) 説明

WSS

SECURITY_VALIDATING

適用なし

有効が有効ではないか、または WS-Security 情報が見つからない場合にスローされます。

WSS

MISSING_CERTIFICATE

適用なし

トラストストアまたはキーストアのどちらからも証明書を取得できない場合にスローされます。

復号化

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

次の例は、キーストアを使用して要求を復号化する方法を示しています。

要求の例
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"><xenc:EncryptedKey Id="EK-D77EFA434E6694DA5315531006937483" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=OLEKSIYS-W3T,OU=Sun Java System Application Server,O=Sun Microsystems,L=Santa Clara,ST=California,C=US</ds:X509IssuerName><ds:X509SerialNumber>1182300426</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=</xenc:CipherValue></xenc:CipherData><xenc:ReferenceList><xenc:DataReference URI="#ED-D77EFA434E6694DA5315531006937494"/></xenc:ReferenceList></xenc:EncryptedKey></wsse:Security></soap:Header>
    <soap:Body><xenc:EncryptedData Id="ED-D77EFA434E6694DA5315531006937494" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference URI="#EK-D77EFA434E6694DA5315531006937483"/></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></soap:Body>
</soap:Envelope>
XML
マルチパート要求の例
------=_Part_8049_2119795515.1555963425591
Content-Type: application/soap+xml
Content-ID: main

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"><xenc:EncryptedKey Id="EK-D77EFA434E6694DA5315531006937483" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=OLEKSIYS-W3T,OU=Sun Java System Application Server,O=Sun Microsystems,L=Santa Clara,ST=California,C=US</ds:X509IssuerName><ds:X509SerialNumber>1182300426</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=</xenc:CipherValue></xenc:CipherData><xenc:ReferenceList><xenc:DataReference URI="#ED-D77EFA434E6694DA5315531006937494"/></xenc:ReferenceList></xenc:EncryptedKey></wsse:Security></soap:Header>
    <soap:Body><xenc:EncryptedData Id="ED-D77EFA434E6694DA5315531006937494" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference URI="#EK-D77EFA434E6694DA5315531006937483"/></wsse:SecurityTokenReference></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></soap:Body>
</soap:Envelope>
------=_Part_8049_2119795515.1555963425591
Content-Type: application/json
Content-Disposition: related; name="file1"; filename="a.json"
Content-ID: file1

{
  "title": "Java 8 in Action",
  "author": "Mario Fusco",
  "year": 2014
}
------=_Part_8049_2119795515.1555963425591--
XML
復号化の例
<wss:inbound-config name="decryption-config">
  <wss:decryption-config>
    <wss:keystore-config path="certificates/decrypt-keystore.jks"
                            password="password"
                            alias="alias"
                            keyPassword="key" />
  </wss:decryption-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="decryption-config" version="SOAP_12"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

UsernameToken の検証

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

次の例は、​LDAP サーバー​または指定された​ユーザー名/パスワード証明書ペア​で検証する方法を示しています。

複数のユーザーを検証するには LDAP 認証を使用します。証明書による検証では、複数のユーザーの検証はサポートされていません。

LDAP 認証

次の例は、LDAP サーバーに対する ​usernameToken​ 検証を示しています。要求からのユーザー名とパスワードは LDAP サーバーで検証されます。

要求の例
<soap:Envelope xmlns:ser="http://service.util.soap.mule.org/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd">
      <wsse:UsernameToken wsu:Id="UsernameToken-D77EFA434E6694DA53155311225135914">
        <wsse:Username>username</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <ser:echo>
      <text>test username</text>
    </ser:echo>
  </soap:Body>
</soap:Envelope>
XML
検証例
<wss:inbound-config name="ldap-config">
  <wss:username-config>
    <wss:authenticate-user-config>
      <wss:ldap-config providerUrl="ldap://localhost:${LDAP_PORT}"
             userDn="cn=admin,dc=example,dc=com"
             password="password"
             searchBase="ou=people,dc=example,dc=com"
             searchFilter="(uid={0})"
             searchInSubtree="false"/>
    </wss:authenticate-user-config>
  </wss:username-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="ldap-config" version="SOAP_12"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

証明書による認証

次の例は、設定されているユーザー名とパスワードのペアを使用した ​usernameToken​ 検証を示しています。

要求の例
<soap:Envelope xmlns:ser="http://service.util.soap.mule.org/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                       xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-D77EFA434E6694DA53155311225135914">
                <wsse:Username>username</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">username</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <ser:echo>
            <text>test username</text>
        </ser:echo>
    </soap:Body>
</soap:Envelope>
XML
マルチパート要求の例
検証例
<wss:inbound-config name="username-config">
  <wss:username-config>
    <wss:authenticate-user-config>
      <wss:credentials-config username="username" password="password"/>
    </wss:authenticate-user-config>
  </wss:username-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/orderTshirt" />
  <wss:validate-wss config-ref="username-config" />
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

署名の検証

次の例は、受信した要求の署名を、設定されている​トラストストア​、​バイナリセキュリティトークン​、または ​X.509 証明書​を使用して検証する方法を示しています。

トラストストア

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

この例では、設定されているトラストストアを使用して要求の署名を検証することで、信頼できる送信者からの有効なメッセージのみを受信しています。

要求の例
<soapenv:Envelope xmlns:ser="http://service.soap.service.mule.org/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd"><ds:Signature Id="SIG-F8FAC4A91BEF76355615530303348205" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ser soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-F8FAC4A91BEF76355615530303348174"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ser" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>yLFLEkH4/MjYbZ4viZxjou9/4os=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>xxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX+xxxxxxxxxxxxxxxxxxxx/xxxxxxxx
xxxxxxx/xxxxxxxxxx
xxxxxxxx+xxx/xxxxxxxxxxx==</ds:SignatureValue><ds:KeyInfo Id="KI-F8FAC4A91BEF76355615530303348132"><wsse:SecurityTokenReference wsu:Id="STR-F8FAC4A91BEF76355615530303348153"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=Unknown,OU=Unknown,O=Unknown,L=Unknown,ST=Unknown,C=US</ds:X509IssuerName><ds:X509SerialNumber>1545521240</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soapenv:Header>
   <soapenv:Body wsu:Id="id-F8FAC4A91BEF76355615530303348174" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd">
      <ser:echo>
         <text>test</text>
      </ser:echo>
   </soapenv:Body>
</soapenv:Envelope>
XML
検証例
<wss:inbound-config name="validate-signature-config">
  <wss:verify-signature-config>
    <wss:truststore-config path="certificates/verify-signature-truststore.jks" password="mulepassword"/>
  </wss:verify-signature-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="validate-signature-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

BinarySecurityToken 署名

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

この例では、トラストストアを使用して、バイナリセキュリティトークンで署名された要求を検証しています。

要求の例
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wor="http://snowyhydro.com.au/workorder-service">
   <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd"><wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.1#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.1#X509PKIPathv1" wsu:Id="X509-B1C61A5DA2BB64CA6A15792851906729">xxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx+xxxxxx/xxxxxxxxxxxxxx</wsse:BinarySecurityToken><ds:Signature Id="SIG-B1C61A5DA2BB64CA6A157928519067613" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="soapenv wor" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-B1C61A5DA2BB64CA6A157928519067312"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="wor" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>H/d9uuvKNSGhJPNoJtm1DhWBQmI=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>xxxxxxxxx+xxxx/xxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==</ds:SignatureValue><ds:KeyInfo Id="KI-B1C61A5DA2BB64CA6A157928519067210"><wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.1#X509PKIPathv1" wsu:Id="STR-B1C61A5DA2BB64CA6A157928519067211" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference URI="#X509-B1C61A5DA2BB64CA6A15792851906729" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.1#X509PKIPathv1"/></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soapenv:Header>
   <soapenv:Body wsu:Id="id-B1C61A5DA2BB64CA6A157928519067312" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd">
      <wor:Workorder>
         <InitiatingEvent>?</InitiatingEvent>
         <OriginatingDocumentNumber>?</OriginatingDocumentNumber>
         <StandardJob>?</StandardJob>
         <WorkorderDescription>?</WorkorderDescription>
         <Originator>?</Originator>
         <MaintenanceType>?</MaintenanceType>
         <EquipmentReference>?</EquipmentReference>
         <WorkorderType>?</WorkorderType>
         <WorkGroup>?</WorkGroup>
         <AccountCode>?</AccountCode>
      </wor:Workorder>
   </soapenv:Body>
</soapenv:Envelope>
XML
検証例
<wss:inbound-config name="validate-signature-config">
  <wss:verify-signature-config>
    <wss:truststore-config path="certificates/sign-keystore.jks" password="mulepassword"/>
  </wss:verify-signature-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="validate-signature-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

X.509 Certificate (X.509 証明書)

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

次の例では、パターンによって X.509 証明書の発行者を検証しています。

要求の例
<soapenv:Envelope xmlns:ser="http://service.soap.service.mule.org/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd"><ds:Signature Id="SIG-F8FAC4A91BEF76355615530303348205" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ser soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-F8FAC4A91BEF76355615530303348174"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ser" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>yLFLEkH4/MjYbZ4viZxjou9/4os=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>xxxxxxxxxxx==</ds:SignatureValue><ds:KeyInfo Id="KI-F8FAC4A91BEF76355615530303348132"><wsse:SecurityTokenReference wsu:Id="STR-F8FAC4A91BEF76355615530303348153"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=Unknown,OU=Unknown,O=Unknown,L=Unknown,ST=Unknown,C=US</ds:X509IssuerName><ds:X509SerialNumber>1545521240</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soapenv:Header>
   <soapenv:Body wsu:Id="id-F8FAC4A91BEF76355615530303348174" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd">
      <ser:echo>
         <text>test</text>
      </ser:echo>
   </soapenv:Body>
</soapenv:Envelope>
XML
検証例
<wss:inbound-config name="validate-signature-config">
  <wss:verify-signature-config issuerPattern="CN=Unknown.*">
    <wss:truststore-config path="certificates/verify-signature-truststore.jks" password="mulepassword"/>
  </wss:verify-signature-config>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="validate-signature-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

タイムスタンプの検証

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

次の例は、受信した SOAP 要求の ​<wsu:Timestamp>​ 要素を検証する方法を示しています。

要求の例
<soap:Envelope xmlns:ser="http://service.util.soap.mule.org/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"
                       xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.1.xsd">
            <wsu:Timestamp wsu:Id="TS-D77EFA434E6694DA5315531011197435">
                <wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
                <wsu:Expires>2001-10-13T09:00:00Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <ser:echo>
            <text>test timestamp</text>
        </ser:echo>
    </soap:Body>
</soap:Envelope>
XML
タイムスタンプの検証例
<wss:inbound-config name="timestamp-config">
  <wss:timestamp-config timeToLive="100" precisionInMilliseconds="true"/>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss config-ref="timestamp-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

SAML の検証

次の例は、受信した SOAP 要求の​署名付き​または​未署名の​ SAML アサーションを検証する方法を示しています。

署名付き SAML アサーション

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

Subject Confirmation Method​ が ​Bearer​ であることが求められる署名付き SAML アサーションの例です。

要求の例
<soap:Envelope xmlns:ser="http://service.soap.service.mule.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"><saml2:Assertion ID="SAML-d328e428-1d0a-422d-b758-1408b0c010c7" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"><saml2:Issuer>WssTest</saml2:Issuer><dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>xX+xxxxxxxxxx=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>mT9648OrsRiYV/xxxx/xxxxxxxx/xxxxxx==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509SubjectName>CN=Unknown,OU=Unknown,O=Unknown,L=Unknown,ST=Unknown,C=US</dsig:X509SubjectName><dsig:X509Certificate>xxxxxxxxxxxx+xxxxxxxxxxxxxxxxxx=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo></dsig:Signature><saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="Mulesoft">o=test</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2:Assertion>
        </wsse:Security>
    </soap:Header>
   <soap:Body>
      <ser:echo>
         <text>test</text>
      </ser:echo>
   </soap:Body>
</soap:Envelope>
XML
署名付き SAML アサーションの検証例
<wss:inbound-config name="validate-saml-config">
  <wss:verify-saml-config samlVersion="SAML20"
        requiredSubjectConfirmationMethod="BEARER"/>
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss version="SOAP_11" config-ref="validate-saml-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML

未署名の SAML アサーション

暗号化操作を実行する場合には、メッセージのペイロードに変換を適用しないでください。変換操作では、暗号化署名が除外されません。

未署名の SOAP メッセージの SAML アサーションの例です。

要求の例
<soap:Envelope xmlns:ser="http://service.soap.service.mule.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.1.xsd"><saml2:Assertion ID="SAML-d328e428-1d0a-422d-b758-1408b0c010c7" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"><saml2:Issuer>WssTest</saml2:Issuer><saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="Mulesoft">o=test</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2:Assertion>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <ser:echo>
            <text>test</text>
        </ser:echo>
    </soap:Body>
</soap:Envelope>
XML
未署名の SAML アサーションの検証例
<wss:inbound-config name="validate-saml-config">
  <wss:verify-saml-config samlVersion="SAML20" />
</wss:inbound-config>

<flow name="OrderTshirtServiceFlow">
  <http:listener config-ref="HTTP-listener-config" path="/order" />
  <wss:validate-wss version="SOAP_11" config-ref="validate-saml-config"/>
  <flow-ref name="OrderTshirtFlowImpl" />
</flow>
XML