我正在尝试使用Websphere 7和JAX-WS开发一个使用WS-Security的web服务。浏览一些指南,我似乎必须创建一个应用程序服务器用户注册表,并在该服务器中维护用户名/密码。有没有什么方法可以避免在服务器本身中创建用户名,并以某种方式捕获标头并基于另一个自定义安全配置进行验证?
我可以创建一个处理程序来获取消息头,但是当请求中的mustUnderstands设置为1(这是必需的)时,它会在我的处理程序看到消息之前被拒绝。
我只打算使用WS-Security的UsernameToken部分。
任何帮助都是非常感谢的。
我的请求的一个示例
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="unt_20">
<wsse:Username>some_username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">some_password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
...body...
</soapenv:Body>
</soapenv:Envelope>是否可以创建自定义安全实现,以便我可以使用现有的用户验证方案?
发布于 2011-09-10 03:14:23
另一个可能的解决方案是创建一个信任关联拦截器(TAI)。这基本上扩展了您当前的安全性。
这是一个有用的入门链接:http://www.ibm.com/developerworks/websphere/techjournal/0508_benantar/0508_benantar.html
发布于 2011-08-15 22:12:49
似乎我可以实现一个自定义用户注册表,该注册表可以与我选择的安全实现进行交互。指向IBM文章的链接:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tsec_useregistry.html
发布于 2015-12-06 00:21:59
您可以使用带有策略/绑定的开箱即用的WS-Security运行时来实现这一点,但是您必须编写自定义代码来覆盖检查用户注册表中的UsernameTokens的默认行为。
有关在使用UsernameToken时使用自己的身份验证机制的信息,请参阅本文:
Configuring a UsernameToken caller configuration with no registry interaction
如果您还想根据令牌中的用户名创建WebSphere凭据,请参阅本文:
Replacing the authentication method of the UsernameToken consumer using a stacked JAAS login module
https://stackoverflow.com/questions/7043222
复制相似问题