我在 IBM WebSphere 上部署了一个 JAX-RS Web 服务,我想在它接收到请求(从其他服务器委托)时保护这个 WS。所以我使用基本身份验证并在 BasicAuthSecurityHandler 对象上设置用户名和密码,并将请求委托给其他服务器。现在,当另一台服务器收到请求时,我在全局安全下使用 WAS 中的联合存储库并进行身份验证。
auth-constraint
如果我在部署描述符中注释掉,则不会进行身份验证。我只想进行身份验证而不进行授权。我尝试@PermitAll
在 Jax-WS 方法上使用注释,但授权也在执行 Jax-WS 方法之前发生。那么有什么方法可以跳过授权并仍然进行身份验证?
我没有与我的用户关联的任何规则,所以我想跳过授权。
<security-constraint id="SecurityConstraint_1">
<display-name>RESTSecurity</display-name>
<web-resource-collection id="WebResourceCollection_1">
<web-resource-name>DelegateReqComApp</web-resource-name>
<description>
Protection area for Rest resource /addresses
</description>
<url-pattern>/rest/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<!-- Authorization Constraint commented out -->
<auth-constraint id="AuthConstraint_1">
<description>
Used to guard resources under this url-pattern
</description>
<role-name>iapawas012</role-name>
</auth-constraint>
</security-constraint>