は、ここで「ResetPassword.html」ページにアクセスすることができ、私のweb.xmlは、Java EEのセキュリティロールを介して迂回する方法
<security-constraint>
<display-name>
change password</display-name>
<web-resource-collection>
<web-resource-name>change password</web-resource-name>
<url-pattern>/ResetPassword.html</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<description>Roles which can access landing page</description>
<role-name>Admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
ユーザーのみ役割を持つ「管理者」からのコード例です。
現在のユーザーが特定の役割にアクセスできるかどうかをテストできるJava EE APIがあります。
request.isUserInRole( "Admin");
DefUserが「ResetPassword.html」ページをアサートできないため、デフォルトユーザー「DefUser」にはロールが割り当てられていないため403エラーが返されます。 DefUserでログインした場合、request.isUserInRole( "Admin")をtrueに戻すことはできますか?それを行う他の方法はありますか?
私はセキュリティの制約を使いたいと思います。これは、ロールが割り当てられていないすべてのページへのアクセス許可を持つ必要がある「DefUser」のようなユーザーがいる可能性のある要件の1つです。
私はこれらのセキュリティ制約を回避したいだけです。 「DefUser」が「ResetPassword.html」ページにアクセスする方法はありますか?
http://www.imrantariq.com/blog/