1

IBM WebSphere にデプロイされた JAX-RS Web サービスがあり、(他のサーバーから委任された) 要求を受信したときにこの WS を保護したいと考えています。したがって、基本認証を使用し、ユーザー名とパスワードを BasicAuthSecurityHandler オブジェクトに設定して、リクエストを他のサーバーに委任します。他のサーバーがリクエストを受信すると、グローバル セキュリティの下で WAS のフェデレーション リポジトリを使用して認証を行います。

デプロイメント記述子でをコメントアウトするauth-constraintと、認証が行われません。認証のみを行い、認可は行いません。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>
4

1 に答える 1

1

ロールを作成し、特別なサブジェクトにauth-constraintマップします。基本的に、認証に成功したすべてのユーザーがサービスの呼び出しを許可されていることを示しています。 上の Web 管理コンソールで、またはEAR inフォルダのバインディング ファイルを介して実行できます。iapawas012ALL_AUTHENTICATED
Enterprise Application > yourApplication > Security role to user/group mappingibm-application-bnd.xmlMETA-INF

<?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>
于 2014-11-24T23:05:14.933 に答える