带有PingFederate的WS-STS,用于使用Axis 1.7.2构建的Web服务

时间:2017-10-30 09:17:17

标签: ws-security pingfederate ws-trust

我发布了一个发布webservices的战争。使用Axis 1.7.2构建和部署Web服务。我已经开发了使用WS-STS保护webservices的代码。这适用于WSO2 Identity Server的安全令牌服务器。

我在PingFederate的STS保护网络服务时遇到了问题。其中一个配置步骤是在连接数据库中添加策略。 java代码将获取策略XML并将其添加到所有Web服务的'services.xml'。

我从以下PingFederate URL获得了WS-Trust策略:

https://localhost:9031/pf/ws-trust_sts_metadata.ping PartnerSpId=CONNECTIONNAME&type=mex

政策内容如下:

<wsp:Policy wsu:Id="username">
<wsp:ExactlyOne>
  <wsp:All>
    <sp:TransportBinding>
      <wsp:Policy>
        <sp:TransportToken>
          <wsp:Policy>
            <sp:HttpsToken RequireClientCertificate="false"/>
          </wsp:Policy>
        </sp:TransportToken>
        <sp:AlgorithmSuite>
          <wsp:Policy>
            <sp:Basic256/>
          </wsp:Policy>
        </sp:AlgorithmSuite>
        <sp:Layout>
          <wsp:Policy>
            <sp:Strict/>
          </wsp:Policy>
        </sp:Layout>
        <sp:IncludeTimestamp/>
      </wsp:Policy>
    </sp:TransportBinding>
    <sp:SignedEncryptedSupportingTokens>
      <wsp:Policy>
        <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
          <wsp:Policy>
            <sp:WssUsernameToken10/>
          </wsp:Policy>
        </sp:UsernameToken>
      </wsp:Policy>
    </sp:SignedEncryptedSupportingTokens>
    <sp:EndorsingSupportingTokens>
      <wsp:Policy>
        <sp:KeyValueToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never" wsp:Optional="true"/>
        <sp:SignedParts>
          <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
        </sp:SignedParts>
      </wsp:Policy>
    </sp:EndorsingSupportingTokens>
    <sp:Wss11>
      <wsp:Policy>
        <sp:MustSupportRefKeyIdentifier/>
        <sp:MustSupportRefIssuerSerial/>
        <sp:MustSupportRefThumbprint/>
        <sp:MustSupportRefEncryptedKey/>
      </wsp:Policy>
    </sp:Wss11>
    <sp:Trust13>
      <wsp:Policy>
        <sp:MustSupportIssuedTokens/>
        <sp:RequireClientEntropy/>
        <sp:RequireServerEntropy/>
      </wsp:Policy>
    </sp:Trust13>
    <wsaw:UsingAddressing/>
  </wsp:All>
</wsp:ExactlyOne>

    The services are failing to deploy with the following exception :

    Caused by: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "wsaw"
 at [row,col {unknown-source}]: [58,29]
    at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
    at com.ctc.wstx.sr.InputElementStack.resolveAndValidateElement(InputElementStack.java:507)
    at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2977)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2837)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:666)
    ... 62 more

如果某人可以指向STE套件或PingFederate教程,那么它将会给予帮助。

1 个答案:

答案 0 :(得分:0)

由于它只是在抱怨命名空间,你是否尝试加载http://www.w3.org/2006/05/addressing/wsdl命名空间?

来源: https://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/