Websphere jax-rs仅身份验证无授权

Websphere jax-rs仅身份验证无授权,websphere,jax-rs,restful-authentication,ibm-was,Websphere,Jax Rs,Restful Authentication,Ibm Was,我在IBMWebSphere上部署了一个JAX-RSWeb服务,我希望在它接收请求(从其他服务器委派)时保护这个WS。 因此,我使用基本身份验证,在BasicAuthSecurityHandler对象上设置用户名和密码,并将请求委托给其他服务器。 现在,当另一台服务器接收到请求时,我使用联邦存储库(Federated repository in)处于全局安全状态并进行身份验证 如果我注释掉部署描述符中的auth约束,则不会进行身份验证。 我只想进行身份验证,不想进行授权。 我尝试在Jax-WS方

我在IBMWebSphere上部署了一个JAX-RSWeb服务,我希望在它接收请求(从其他服务器委派)时保护这个WS。 因此,我使用基本身份验证,在BasicAuthSecurityHandler对象上设置用户名和密码,并将请求委托给其他服务器。 现在,当另一台服务器接收到请求时,我使用联邦存储库(Federated repository in)处于全局安全状态并进行身份验证

如果我注释掉部署描述符中的
auth约束
,则不会进行身份验证。 我只想进行身份验证,不想进行授权。 我尝试在Jax-WS方法上使用
@PermitAll
注释,但是在执行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>

RESTSecurity
DelegateReqComApp
Rest资源/地址的保护区
/休息/*
得到
邮递
用于保护此url模式下的资源
iapawas012

创建
auth约束
并将
iapawas012
角色映射到特殊主题
ALL\u AUTHENTICATED
。它基本上说,任何成功进行身份验证的用户都有权调用您的服务。
您可以在
Enterprise Application>yourApplication>安全角色到用户/组映射的web管理控制台中执行此操作,也可以通过
META-INF
文件夹中EAR中的绑定文件
ibm Application bnd.xml
执行此操作:

<?xml version="1.0" encoding="UTF-8"?>
<application-bnd
    xmlns="http://websphere.ibm.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
    version="1.2">

    <security-role name="iapawas012">
        <special-subject type="ALL_AUTHENTICATED_USERS" />
    </security-role>
</application-bnd>