标签: rampart

Rampart PostDispatchVerificationHandler:InvalidSecurity - 找不到安全策略

编辑:

我稍稍调整了Rampart配置,现在我又陷入了另一个角度.

在Rampart的PostDispatchVerificationHandler中,抛出异常,因为尚未处理安全标头.

// If a security header is there and Rampart is engaged, it has to be processed.  
// If it is not processed, there must have been a problem in picking the policy 

SOAPHeaderBlock secHeader = getSecurityHeader(msgContext);
if (secHeader != null && (secHeader.isProcessed() == false)) {
     throw new AxisFault("InvalidSecurity - Security policy not found");
}
Run Code Online (Sandbox Code Playgroud)

日志:

[DEBUG] [MessageContext: logID=a5012f2f13095af97123a192575c50a7f727850f3a9ecfc5] Invoking Handler 'HTTPLocationBasedDispatcher' in Phase 'Dispatch'
[DEBUG] [MessageContext: logID=a5012f2f13095af97123a192575c50a7f727850f3a9ecfc5] Invoking Handler 'Post dispatch security verification handler' in Phase 'Dispatch' …
Run Code Online (Sandbox Code Playgroud)

java ws-security axis2 web-services rampart

19
推荐指数
1
解决办法
4231
查看次数

在axis/rampart客户端中禁用InclusiveNamespaces

我正在连接到具有axis/rampart的web服务,并被告知要删除InclusiveNamespaces,因为prefixList是"",这是不允许的.我怎么做?

部分看起来像

<ds:SignedInfo>
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
        <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa soapenv" />
    </ds:CanonicalizationMethod>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
    <ds:Reference URI="#Id-289005241">
        <ds:Transforms>
            <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">              
                <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="" />
            </ds:Transform>
        </ds:Transforms>
        <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />                          
        <ds:DigestValue>bla bla bla=</ds:DigestValue>
    </ds:Reference>
</ds:SignedInfo>
Run Code Online (Sandbox Code Playgroud)

是否可以将轴/ rampart配置为在其为空时不打印包含名称空间?

我正在使用axis/rampart 1.6.2并连接到.NET服务

任何想法如何存档?或者我如何使它呈现非空前缀列表?

java ws-security axis2 rampart

16
推荐指数
1
解决办法
826
查看次数

如何使用Axis2和Rampart在SOAP请求中添加MessageID

我正在尝试使用Axis2和构建一个使用外部服务器应用程序的客户端应用程序rampat 1.6.

检查SOAP请求时,一切似乎都很好,因为SOAP按预期加密和签名.以下是用于此目的的policy.xml文件:

<wsp:Policy wsu:Id="MyPolicy"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
    xmlns:wsam="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
    xmlns:wst="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">
<wsp:ExactlyOne>
    <wsp:All>
        <sp:SignedSupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
            <wsp:Policy>
                <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient" />
            </wsp:Policy>
        </sp:SignedSupportingTokens>
        <sp:SymmetricBinding>
            <wsp:Policy>
                <sp:ProtectionToken>
                    <wsp:Policy>
                        <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                            <wsp:Policy>
                                <sp:RequireIssuerSerialReference/>
                                <sp:WssX509V3Token10/>
                            </wsp:Policy>
                        </sp:X509Token>
                    </wsp:Policy>
                </sp:ProtectionToken>

                <sp:AlgorithmSuite>
                    <wsp:Policy>
                        <sp:Basic128/>
                    </wsp:Policy>
                </sp:AlgorithmSuite>
                <sp:IncludeTimestamp/>
                <sp:Layout>
                    <wsp:Policy>
                        <sp:Strict/>
                    </wsp:Policy>
                </sp:Layout>
                <sp:OnlySignEntireHeadersAndBody/>
            </wsp:Policy>
        </sp:SymmetricBinding>
        <sp:EncryptedParts>
            <sp:Body />
        </sp:EncryptedParts>
        <sp:SignedParts>
            <sp:Body/>
            <sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"/>
            <sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"/>
            <sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"/>
            <sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="AckRequested"/>
            <sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="CreateSequence"/>
            <sp:Header Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" Name="Sequence"/>
            <sp:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"/>
            <sp:Header Namespace="http://www.w3.org/2005/08/addressing" …
Run Code Online (Sandbox Code Playgroud)

xml soap axis2 web-services rampart

12
推荐指数
1
解决办法
929
查看次数

如何在Rampart/C(Axis2/C)中反序列化SAML断言?

我在utf-8 char *缓冲区中有SAML 1.1和SAML 1.0响应,我想将它们转换为Rampart/C saml_response_t *对象.我的问题是:

saml_response_t从字符串创建a的正确方法是什么?

理想情况下,我想在C中使用代码示例来执行此操作,然后以正确的顺序处理各种解析器工具,因为Axis2/C对于如何释放内存有一些奇怪的想法.

我这样做的努力遇到了失败,主要是因为内存故障,但这就是我所拥有的.请记住,该deserialize_buffer()方法正如它所说的那样 - 将缓冲区转换为a axiom_node_t *,但我也愿意替换它.

/* : get the raw XML from the SAML assertion */
xml_data = Tcl_GetStringFromObj (objv[2], &xml_length);

/* : parse the response XML for processing */
stream = gstream_mem_create (xml_data, xml_length);
node = Axis2_axiom_deserialize_buffer (env, stream);

/* : build a SAML response from the parsed XML */
saml_response = saml_response_create (env);
saml_response_build (saml_response, node, env);
arraylist = saml_response_get_assertions (saml_response, env);

/* …
Run Code Online (Sandbox Code Playgroud)

axis2c rampart saml

8
推荐指数
0
解决办法
904
查看次数

Apache Rampart是否可以与maven一起使用?

在我正在工作的项目中,我们使用maven来管理依赖项.但是我们遇到了apache rampart的问题,它是Axis2的安全模块.我们尝试使用以下依赖项标记:

    <dependency>
        <groupId>org.apache.rampart</groupId>
        <artifactId>rampart</artifactId>
        <version>1.3</version>
        <type>mar</type>
    </dependency>

    <dependency>
        <groupId>org.apache.rampart</groupId>
        <artifactId>rampart</artifactId>
        <version>1.4</version>
        <type>mar</type>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

发生的事情是,maven无法找到作为wallart pom文件中的依赖项包含的大量资源(请注意,maven会自动下载rampart pom文件,因此我不应该编辑这些文件).

当输入maven无法找到的rampart依赖项的URI时,我收到404错误.看起来apache的壁垒pom文件坏了......

有人成功地使用了与maven的垒垒吗?这是与maven破解的apache垒集合吗?

java apache soap axis2 rampart

5
推荐指数
1
解决办法
3190
查看次数

如何在Axis2 JAX-WS服务(提供者端)中启用WS-Security(Rampart)?

在Axis2中部署JAX-WS服务时是否可以指定安全策略断言?到目前为止,我发现只有一种方法是全局配置策略(即在axis2.xml中).但它可以在JAXWS JAR中完成吗?

java axis2 jax-ws rampart

5
推荐指数
1
解决办法
1589
查看次数

使用带有自己的安全框架的axis2 ramaprt模块

我在我的项目中使用axis2实现了webservice(服务器端).我们希望在现有Web服务中启用WS-security.我们正在评估apache ramapart模块是否符合我们的需求.这是我们的要求:基本上我们有内部安全框架,提供加密,签名和令牌生成功能.我们的内部安全框架基本上需要以XML形式的一组配置,并且它公开各种API以执行各种安全操作.

现在有了上述环境,我可以想到三种可能的解决方案: -

  1. 我可以围绕内部安全框架开发一个axis2模块,并在安全阶段将其安装为.mar文件.所以我不会使用apache rampart.但是这种方法的问题是我不能使用ws-security策略来指定安全断言并确保传入的安全性令牌符合有效的策略.这就像重新发明轮子已经做的那样.

  2. 我相信apache rampart强调要求apache wss4j模块进行安全操作.我相信apache wss4j模块提供了一种注册第三方安全提供程序的方法(通过实现CryptoProvider接口).我不确定这是否是可行和可行的解决方案.请建议.

  3. Ws-security策略允许使用自定义令牌.可以使用我们的内部安全框架构建此自定义令牌.所以基本上它使我们能够使用apache rampart模块创建ws-security策略,并使用我们的安全框架开发自定义令牌.但我在互联网上找不到这方面的帮助.有谁可以帮助举例.

任何其他建议也是最受欢迎的.

java ws-security axis2 web-services rampart

5
推荐指数
1
解决办法
500
查看次数

Axis2:无法使用Rampart模块

尝试在Axis2中使用Rampart实现WS-Security时,我收到以下错误.

org.apache.axis2.AxisFault: Unable to engage module : rampart
at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:358)
Run Code Online (Sandbox Code Playgroud)

我在嵌入模式下使用轴(在我耳中).没有安全实现,服务正常工作.我已将该策略包含在services.xml中以及WSDL中.使用Jboss和JDK6请查看下面的文件.

Axis2.xml

<wsdl:definitions xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://service">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service">
<xs:element name="echo">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="args0" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="echoResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="echoRequest">
<wsdl:part name="parameters" element="ns:echo"></wsdl:part>
</wsdl:message>
<wsdl:message name="echoResponse">
<wsdl:part name="parameters" element="ns:echoResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="SimpleServicePortType">
<wsdl:operation name="echo">
<wsdl:input message="ns:echoRequest" wsaw:Action="urn:echo"></wsdl:input>
<wsdl:output message="ns:echoResponse" wsaw:Action="urn:echoResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SimpleServiceSoap11Binding" …
Run Code Online (Sandbox Code Playgroud)

java ws-security axis2 web-services rampart

2
推荐指数
1
解决办法
7653
查看次数

将 UsernameToken (WS-Security-Header) 添加到 SOAP 消息

我正在尝试连接到现有的 SOAP Web 服务。我提供了一个 wsdl,从中我通过 Apache Axis2 XMLBeans 创建了 Java 类。

但是现在我必须使用 WS-Security-Header 扩展我自己编写的客户端发送的消息。我怎样才能做到这一点?

我为此找到了 Apache Rampart 项目,但找不到任何解决方案来扩展从我的 Java 类创建的消息,并使用此类标头。我只能找到为服务建立 WS 安全性的机会(在 webapp 文件夹等中)。

我对你的回答感到兴奋!

感谢您的帮助!

java ws-security soap axis2 rampart

2
推荐指数
1
解决办法
6707
查看次数

添加Axis 2客户端依赖项后,Spring Boot启动失败

我正在开发一个使用Soap Web服务的演示应用程序,我正在使用axis 2作为客户端.我决定使用Spring启动并将我的代码合并到其中.起初,简单的Spring Boot完全没问题,我可以创建一个demo jsp页面和一些其他的web服务.在我将存根代码jar文件以及Axis和Rampart依赖项添加到pom.xml之后,它在启动时不断出现错误.

这是pom.xml的代码片段,只需添加即可轻松复制该问题

<dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-metadata</artifactId>
            <version>1.7.1</version>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

进入一个简单的spring boot pom.xml文件,该文件使用嵌入式tomcat和jasper.

的pom.xml

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.7.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
...
<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <axis.version>1.7.1</axis.version>
        <rampart.version>1.7.1</rampart.version>
    </properties>
...

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
<dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>

        </dependency>

...
<dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-metadata</artifactId>
            <version>${axis.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
</dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin> …
Run Code Online (Sandbox Code Playgroud)

spring axis2 rampart maven spring-boot

1
推荐指数
1
解决办法
609
查看次数

标签 统计

rampart ×10

axis2 ×9

java ×7

ws-security ×5

web-services ×4

soap ×3

apache ×1

axis2c ×1

jax-ws ×1

maven ×1

saml ×1

spring ×1

spring-boot ×1

xml ×1