按照此
http://symfony.com/doc/current/security/custom_authentication_provider.html
结果是
服务“security.authentication.provider.wsse.wsse_secured”:如果尚未配置参数,则无法替换参数。
我在任何地方都找不到有关此错误的任何信息。这使用了文档的 WSSE 代码,但它失败了。
这个 repo 显示它失败了https://github.com/jakenoble/wsse_test
我想让它最终与 FOS 用户包一起工作。但是我不能让它与基本的 Symfony3 安装一起工作,所以 FOS User Bundle 目前是不可能的。
挖了一点...
有在元件的一个ARGindex_0上类Symfony\Component\DependencyInjection\ChildDefinition在元件为arg的对象index_0具有一个id fos_user.user_provider.username_email。
然后替换调用尝试获取 的参数fos_user.user_provider.username_email,但没有。然后出现错误。
有任何想法吗?
我从供应商API获得以下内容:

我需要用php创建一个Soap调用.我该怎么做呢?到目前为止,我有这个:但它不起作用:
private function booking_soap_connect() {
// the wsdl URL of your service to test
$serviceWsdl = 'https://apitest.com/bookingapi.asmx?WSDL';
// the parmeters to initialize the client with
$serviceParams = array(
'login' => 'un',
'password' => 'pw'
);
// create the SOAP client
$client = new SoapClient($serviceWsdl, $serviceParams);
$data['Brand'] = "All";
$data['TourCode'] = "QBE";
$data['DepartureCode'] = "8000321";
$data['VendorId'] = "test";
$data['VendorPassword'] = "test";
$results = $client->GVI_DepartureInfo($data)
echo $results;
}
Run Code Online (Sandbox Code Playgroud)
请帮忙
我正在使用 symfony2 开发 API,并且已经实现了 WSSE 身份验证。我需要跳过某些 URL 的身份验证,因为它们可以公开访问。公开访问的 URL 的格式如下:
www.myserver.com/api/v1/public/testaction1
www.myserver.com/api/v1/public/testaction2
Run Code Online (Sandbox Code Playgroud)
还有一个可公开访问的 URL,它是 API 的文档:
www.myserver.com/api/doc/
Run Code Online (Sandbox Code Playgroud)
除了上述 URL 之外,所有其他操作都应在身份验证方案下进行,我尝试在防火墙配置选项下调整 URL 模式,如下所示:
安全.yml
firewalls:
wsse_secured:
pattern: ^/api/[^doc | ^v1\/public/].*
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用,您能帮我从身份验证中跳过这些 URL 吗?我是否缺少正确的正则表达式?
编辑
这是我的 security.yml 的访问控制部分
access_control:
- {path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY}
Run Code Online (Sandbox Code Playgroud) 我正在考虑在 Symfony2 中构建 REST API,并且在他们的自定义身份验证提供程序中,他们展示了如何构建 WSSE 身份验证系统,这对于我需要做的事情应该没问题。我将首先通过 cURL 构建和测试 API,因此我需要能够快速生成标头。我找到了一个JS 生成器,它显示了我需要的标题。
从我读到的内容来看,密码摘要应该是按顺序连接在一起的随机数、时间戳和用户密码的 base64 编码的 SHA1。我从以下数据开始:
$nonce = '4c5625ec7af5bdff';
$timestamp = '2013-04-03T04:46:19Z';
$password = 'mypass';
Run Code Online (Sandbox Code Playgroud)
并生成摘要:
$digest = base64_encode(sha1($nonce.$timestamp.$password));
Run Code Online (Sandbox Code Playgroud)
我不明白的是$digest变量现在设置为YTgxMDUzOWQzMDBiZmU1MmI2NWQ0YjYwNDc3ZmY5OWI3MmVlZTQyNA==,但是来自 JS 生成器的示例 PasswordDigest 显示为qBBTnTAL/lK2XUtgR3/5m3Lu5CQ=. 我一定在某处遗漏了一步,但我不确定它是什么。
我在iOS中需要一些WSSE Header生成的帮助.它在Symfony2中编写的应用程序使用sha512算法,5000次迭代,encode_as_base64为true.对于移动应用程序,我发现这个问题用于编码密码:SHA512 with salt for iOS虽然它只是一次迭代.使用包含最后一个的简单循环就足够了吗?
我们找到了WSSE Headers的Android代码:http://obtao.com/blog/2013/09/how-to-use-wsse-in-android-app/有可能做同样的事情在iOS或我们应该找到另一种身份验证方式,比如OAuth2?
我在Spring应用程序上使用httpBasic身份验证有多个工作SOAP Web服务,我需要在其中一个上使用WS-Security来允许使用以下Soap Header进行身份验证.
<soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:UsernameToken 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" wsu:Id="UsernameToken-1">
<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>
Run Code Online (Sandbox Code Playgroud)
当前WSConfiguration根据做https://github.com/spring-projects/spring-boot/blob/master/spring-boot-samples/spring-boot-sample-ws/给像
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
return new ServletRegistrationBean(servlet, "/services/*");
}
@Bean(name = "SOAP1")
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema soap1) {
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
wsdl11Definition.setPortTypeName("Soap1");
wsdl11Definition.setLocationUri("/soap1/");
wsdl11Definition.setTargetNamespace("http://mycompany.com/hr/definitions");
wsdl11Definition.setSchema(soap1);
return wsdl11Definition;
}
@Bean
public XsdSchema soap1() {
return new SimpleXsdSchema(new ClassPathResource("META-INF/schemas/hr.xsd"));
}
}
Run Code Online (Sandbox Code Playgroud)
和http://spring.io/blog/2013/07/03/spring-security-java-config-preview-web-security/的 Web Security 看起来像这样
@EnableWebSecurity …Run Code Online (Sandbox Code Playgroud) 我正在尝试与我无法控制的Java Web服务进行通信,并且我正在尝试创建一个可以正常工作的绑定.
includeTimestamp="false"属性,我必须使用a <customBinding>. <mtomMessagingEncoding>元素.这是我的<bindings>元素:
<bindings>
<customBinding >
<binding name="MyBindingName" >
<mtomMessageEncoding />
<transactionFlow />
<security authenticationMode="UserNameOverTransport"
includeTimestamp="false">
</security>
</binding>
</customBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
SOAP Web服务要求邮件头采用以下格式:
<soap:Envelope ... >
<soap:Header ... >
<wsse:UsernameToken>
<wsse:Username>doo</wsse:Username>
<wsse:Password Type="wsse:PasswordText">fuss</wsse:Password>
</...>
</...>
</...>
Run Code Online (Sandbox Code Playgroud)
我最接近的是:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1"></a:Action>
<a:MessageID>urn:uuid:a368e205-a14d-4955-bf75-049cdd3a78c0</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">https://blablabla</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">
<o:UsernameToken u:Id="uuid-0f1e399b-31a8-4e00-a57f-277c21e94879-1">
<o:Username><!-- Removed--></o:Username>
<o:Password><!-- Removed--></o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
Run Code Online (Sandbox Code Playgroud)
我相信我在这里错过了一些琐碎和愚蠢的东西,但对于我的生活,我无法弄清楚它可能是什么.