Note that there are some explanatory texts on larger screens.

plurals
  1. POGAE REST service and HTTP Basic authentication with Spring Security
    primarykey
    data
    text
    <p>I am trying to implement HTTP Basic authentication with Spring Security for REST services based on JAX-RS Jersey and running on App Engine. I have found several examples and tutorials but it does not work for me. Whenever I access a resource no authentication is needed and 200 OK is retuned along with corresponding body.</p> <p>Below is excerpt from my web.xml.</p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; /WEB-INF/application-context.xml /WEB-INF/security-context.xml &lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;filter&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;url-pattern&gt;/resources/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;servlet&gt; &lt;servlet-name&gt;SystemServiceServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.google.api.server.spi.SystemServiceServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;services&lt;/param-name&gt; &lt;param-value/&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet&gt; &lt;servlet-name&gt;JerseyServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt; &lt;param-value&gt;com.example.endpoint&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;JerseyServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/resources/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>And here is excerpt from security-context.xml.</p> <pre><code>&lt;sec:http create-session="stateless"&gt; &lt;sec:intercept-url pattern="/resources/**" access="ROLE_USER" /&gt; &lt;sec:http-basic /&gt; &lt;/sec:http&gt; &lt;sec:authentication-manager&gt; &lt;sec:authentication-provider&gt; &lt;sec:user-service&gt; &lt;sec:user name="admin" password="0000" authorities="ROLE_USER" /&gt; &lt;/sec:user-service&gt; &lt;/sec:authentication-provider&gt; &lt;/sec:authentication-manager&gt; </code></pre> <p>Can anyone see what is wrong?</p>
    singulars
    1. This table or related slice is empty.
    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.
    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