security上下文令牌

dpiehjr4  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(132)

web服务提供商在.net中实现了ws-security以保护其web服务。我不知道如何根据ws-security标准在java中生成安全上下文令牌?
我 checkout 了apacherampart策略,但发现该策略的任何请求都没有安全上下文令牌节点。还没开始呢。
有人能帮忙吗?
下面是soap头示例。

<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>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题