2

何らかの理由でユーザー名とパスワードの入力を求めない、BASIC 認証を使用する非常に単純な Weblogic 10.3.5 Web アプリケーションを作成しました。web.xml と weblogic.xml は適切に作成されていると思います。アプリケーション全体は以下にあります。

次の 2 つのファイルで構成されます。

  1. index.html -- 誰でも読み込めるはずです
  2. remoteuser.jsp -- 「グループ」内の人だけがロードできるようにする必要があります

すべての JSP (*.jsp)を追加して<auth-constraint>、「グループ」内のユーザーのみが JSP をロードできるようにしました。しかし、URL "/remoteuser.jsp" をロードすると、" The remote user is null" が表示され、ユーザー名とパスワードの入力を求められません。nullこれにより、リモート ユーザーの名前の代わりにJSP も出力されます。

もちろん、<auth-method>BASICに設定されています。

私は現在、Weblogic のセキュリティ レルムで定義されたグループさえ持っていません。最初にそれが失敗するのを見たいからです。

この Weblogic ドキュメント ( http://docs.oracle.com/cd/E15051_01/wls/docs103/security/thin_client.html#wp1037337 ) によると、私はすべてを正しく行っていると思います。

Weblogic セキュリティ レルムの認証プロバイダを変更する必要はありますか? それとも他の設定?

ばかげたことをしていることはわかっていますが、それを見ることはできません助けてください!


ソースファイル

web.xml

<web-app>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>JSPs</web-resource-name>
            <url-pattern>*.jsp</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>group</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>BASIC</auth-method>
    </login-config>

    <security-role>
        <role-name>group</role-name>
    </security-role>
</web-app>

weblogic.xml

<weblogic-web-app>

     <security-role-assignment>
         <role-name>group</role-name>
         <principal-name>group</principal-name>
     </security-role-assignment>

</weblogic-web-app>

remoteuser.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Remote User</title>
</head>
<body>
    <p>
        Only users in "group" should be able to load this page.
    </p>
    <p>
        The remote user is <%= request.getRemoteUser() %>
    </p>
</body>
</html>

index.html

<html>
<head><title>WebLogic Test</title></head>

<body>
    <h1>Everyone should be able to see this.<br>
</body>
</html>
4

2 に答える 2

0

ええと...今はうまくいっていますが、私が何をしたのか正確にはわかりません。

「DDのみ」または「カスタムロール」のセキュリティモデルを使用してアプリケーションを展開するときに機能することは知っています。

ただし、「カスタムの役割とポリシー」を使用して展開すると失敗します。これについての説明は、Use only roles and policies that are defined in the Administration Console. まさに私が役割とポリシーを定義している場所であるため、非常に混乱しているようです!! はぁ。

于 2012-12-12T19:12:16.963 に答える