Note that there are some explanatory texts on larger screens.

plurals
  1. POServlet 3.0 odd declarative security behavior
    primarykey
    data
    text
    <p>I have a security constraint declared in web.xml:</p> <pre><code> &lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;LoggedIn&lt;/web-resource-name&gt; &lt;url-pattern&gt;/screens/*&lt;/url-pattern&gt; &lt;/web-resource-collection&gt; &lt;auth-constraint/&gt; &lt;user-data-constraint&gt; &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt; &lt;/user-data-constraint&gt; &lt;/security-constraint&gt; </code></pre> <p>After logging in, when I make a GET request against the application I get the expected behavior e.g.</p> <p><code>https://localhost:8443/Patrac/screens/user.xhtml</code> --> results in access denied.</p> <p>However, when I do a postback e.g.</p> <p><code>&lt;rich:menuItem submitMode="ajax" label="User" action="/screens/user"/&gt;</code></p> <p>I can view the screen. If I do a second identical postback, I get the access denied message. Each time I submit a postback the result alternates between displaying the screen and issuing a 403. The URL displayed in the browser alternates between the following:</p> <p><code>https://localhost:8443/Patrac/screens/user.xhtml</code> --> browser URL when access denied </p> <p><code>https://localhost:8443/Patrac/public/403.xhtml</code> --> browser URL when user screen is displayed</p> <p>I understand the way the displayed browser URL in JSF lags behind the screen that is currently displayed, so that's no mystery. But I don't understand how I'm able to view the screen every other time the same postback is submitted. Again, GET requests are always denied.</p> <p><strong>EDIT :</strong></p> <p>I did try post-redirect-get and that made the strange behavior go away, as expected.</p> <pre><code>&lt;rich:menuItem submitMode="ajax" label="User" action="/screens/user?faces-redirect=true"/&gt; </code></pre> <p>However, I don't want to do PRG every time and besides PRG doesn't eliminate the security problem.</p> <p>What am I missing here? Thanks for any insights!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload