在Java中生成WS-Security安全上下文令牌
web服务提供商在.net中实现了WS-Security以保护其web服务。我不知道如何根据WS-security标准在java中生成安全上下文令牌 我签出Apache Rampart策略,但发现该策略的任何请求都没有安全上下文令牌节点。没有先发制人 有人能帮忙吗 下面是soap标题示例在Java中生成WS-Security安全上下文令牌,java,ws-security,Java,Ws Security,web服务提供商在.net中实现了WS-Security以保护其web服务。我不知道如何根据WS-security标准在java中生成安全上下文令牌 我签出Apache Rampart策略,但发现该策略的任何请求都没有安全上下文令牌节点。没有先发制人 有人能帮忙吗 下面是soap标题示例 <s:Header> <a:Action s:mustUnderstand = "1">url</a:Action> <a:MessageID>u
<s:Header>
<a:Action s:mustUnderstand = "1">url</a:Action>
<a:MessageID>urn:uuid:044c513b-5c79-4d32-8ef7-e5be7d32dd9a</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand = "1">service provider url</a:To>
<o:Security s:mustUnderstand = "1" xmlns:o = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id = "_0">
<u:Created>2016-01-20T17:01:54.480Z</u:Created>
<u:Expires>2016-01-20T17:06:54.480Z</u:Expires>
</u:Timestamp>
<c:SecurityContextToken u:Id = "uuid-58ee82ff-1b76-4228-8c86-1d99dee0122e-5" xmlns:c = "http://schemas.xmlsoap.org/ws/2005/02/sc">
<c:Identifier>urn:uuid:b2cb2469-3b5a-49a9-9ddf-f1441f194012</c:Identifier>
</c:SecurityContextToken>
<Signature xmlns = "http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm = "http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
<Reference URI = "#_0">
<Transforms>
<Transform Algorithm = "http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm = "http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>6pHwg2hMn0bYulROisZFtKXHi+c=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>TJIjNDK87fY2oZ3lD6iTFzaOCKU=</SignatureValue>
<KeyInfo>
<o:SecurityTokenReference>
<o:Reference ValueType = "http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI = "#uuid-58ee82ff-1b76-4228-8c86-1d99dee0122e-5"/>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</o:Security>
</s:Header>
网址
urn:uuid:044c513b-5c79-4d32-8ef7-e5be7d32dd9a
http://www.w3.org/2005/08/addressing/anonymous
服务提供商url
2016-01-20T17:01:54.480Z
2016-01-20T17:06:54.480Z
urn:uuid:b2cb2469-3b5a-49a9-9ddf-f1441f194012
6pHwg2hMn0bYulROisZFtKXHi+c=
TJIjNDK87fY2oZ3lD6iTFzaOCKU=
提问时,尽量具体。因为你的问题太宽泛了,并且没有显示你已经做过的尝试,大多数用户会浏览这个问题而不回答它,即使他们知道它。@joe,你找到了一种方法吗。我也有同样的感觉当我问问题的时候,尽量具体一些。因为你的问题太宽泛了,并且没有显示你已经做过的尝试,大多数用户会浏览这个问题而不回答它,即使他们知道它。@joe,你找到了一种方法吗。我也有同样的自尊心