Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Security 3.1 and JSP taglibs not working
    text
    copied!<p>The Spring Security Docs ( <a href="http://static.springsource.org/spring-security/site/docs/3.1.x/reference/taglibs.html#d0e6875" rel="nofollow">http://static.springsource.org/spring-security/site/docs/3.1.x/reference/taglibs.html#d0e6875</a> ) says the following:</p> <p>You can use the security taglibs to authorize access by URLs like so:</p> <blockquote> <p><code>&lt;sec:authorize url="/admin"&gt;</code> This content will only be visible to users who are authorized to send requests to the "/admin" URL. <code>&lt;/sec:authorize&gt;</code></p> </blockquote> <p>To use this tag there must also be an instance of WebInvocationPrivilegeEvaluator in your application context. <strong>If you are using the namespace, one will automatically be registered</strong>.</p> <p>OK, now...</p> <p>I just upgraded from Spring Security 3.0 to 3.1</p> <p>In SS 3.0, the JSP tags using URL based access worked perfectly. When dropping in the 3.1 jars, it stopped working.</p> <p>I am using the Spring Security namespace. Therefore, I <strong>should</strong> have everything required to make the JSP tags work, but they don't. Everything else about the configuration is working with my application. The <strong>only</strong> thing not working is URL-based access with the JSP tags.</p> <p>My config looks like the following (updated for SS 3.1). What am I missing?</p> <pre><code>&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" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt; &lt;security:global-method-security secured-annotations="enabled"/&gt; &lt;security:http pattern="/feed/**" create-session="stateless" entry-point-ref="digestEntryPoint" authentication-manager-ref="webAuthenticationManager" use-expressions="true"&gt; &lt;security:http-basic/&gt; &lt;custom-filter ref="digestFilter" after="BASIC_AUTH_FILTER" /&gt; &lt;/security:http&gt; &lt;security:http name="webHttp" auto-config="true" use-expressions="true" authentication-manager-ref="webAuthenticationManager"&gt; &lt;!-- Restrict URLs based on role --&gt; &lt;security:intercept-url pattern="/auth/login" access="permitAll" /&gt; &lt;security:intercept-url pattern="/auth/autologin" access="permitAll" /&gt; &lt;security:intercept-url pattern="/auth/logout" access="isAuthenticated()" /&gt; &lt;security:intercept-url pattern="/auth/loginSuccess" access="" /&gt; &lt;!-- empty access tag. The method checks for authenticated user --&gt; &lt;security:intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" /&gt; &lt;!-- Override default login and logout pages --&gt; &lt;security:form-login login-page="/auth/login" login-processing-url="/auth/loginProcess" default-target-url="/auth/loginSuccess" authentication-failure-url="/auth/login?error=1" /&gt; &lt;security:logout logout-url="/auth/logout" logout-success-url="/" /&gt; &lt;security:remember-me key="remembermekey" user-service-ref="userDetailsService"/&gt; &lt;security:session-management invalid-session-url="/auth/login"/&gt; &lt;/security:http&gt; &lt;beans:bean id="digestFilter" class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter"&gt; &lt;beans:property name="userDetailsService" ref="userDetailsService" /&gt; &lt;beans:property name="authenticationEntryPoint" ref="digestEntryPoint" /&gt; &lt;/beans:bean&gt; &lt;beans:bean id="digestEntryPoint" class="org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint"&gt; &lt;beans:property name="realmName" value="Contacts Realm via Digest Authentication" /&gt; &lt;beans:property name="key" value="acegi" /&gt; &lt;/beans:bean&gt; &lt;security:authentication-manager id="webAuthenticationManager" alias="webAuthenticationManager"&gt; &lt;security:authentication-provider user-service-ref="userDetailsService"&gt; &lt;security:password-encoder hash="md5"/&gt; &lt;/security:authentication-provider&gt; &lt;/security:authentication-manager&gt; &lt;/beans:beans&gt; </code></pre>
 

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