Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Security 3.0 - Intercept-URL - All pages require authentication but one
    text
    copied!<p>I want any user to be able to submit their name to a volunteer form but only administrators to be able to view any other URL. Unfortunately I don't seem to be able to get this correct. My resources.xml are as follows;</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt; &lt;http realm = "BumBumTrain Personnel list requires you to login" auto-config="true" use-expressions="true"&gt; &lt;http-basic/&gt; &lt;intercept-url pattern="/person/volunteer*" access=""/&gt; &lt;intercept-url pattern="/**" access="isAuthenticated()" /&gt; &lt;/http&gt; &lt;authentication-manager alias="authenticationManager"&gt; &lt;authentication-provider&gt; &lt;user-service&gt; &lt;user name="admin" password="admin" authorities="ROLE_ADMIN"/&gt; &lt;/user-service&gt; &lt;/authentication-provider&gt; &lt;/authentication-manager&gt; &lt;/beans:beans&gt; </code></pre> <p>Specifically I am trying to achieve the access settings I described via;</p> <pre><code> &lt;intercept-url pattern="/person/volunteer*" access=""/&gt; &lt;intercept-url pattern="/**" access="isAuthenticated()" /&gt; </code></pre> <p>Could someone please describe how to use intercept-url to achieve the outcome I've described?</p> <p>Thanks</p> <p>Gav</p> <hr> <p>For whatever reason in a grails app I needed;</p> <pre><code> &lt;intercept-url pattern="/person/volunteer/**" access="" filters="none"/&gt; &lt;intercept-url pattern="/images/**" access="" filters="none"/&gt; &lt;intercept-url pattern="/css/**" access="" filters="none"/&gt; &lt;intercept-url pattern="/js/**" access="" filters="none"/&gt; &lt;intercept-url pattern="/**" access="ROLE_ADMIN" /&gt; </code></pre> <p>To get this to work, note the difference in the first rule.</p>
 

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