This content has been marked as final.
Show 1 reply
-
1. Re: RestEasy and URL Rewrite
phillip Jul 16, 2009 5:14 PM (in response to phillip)I've made some progress by writing my own nasty rewrite filter, this now rewrites the url and is executing RestEasy resource but the authentication filter is not firing correctly
<web:authentication-filter url-pattern="/seam/resource/api/*" auth-type="basic" />
Here is the filter
@Startup @Scope(ScopeType.APPLICATION) @Name("apiRewriteFilter") @BypassInterceptors @Filter @Install(value = true, precedence = Install.APPLICATION) public class APIRewriteFilter extends AbstractFilter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String fullPath = ((HttpServletRequest)request).getRequestURI(); if (fullPath.startsWith("/api/")) { RequestDispatcher dispatcher = request.getRequestDispatcher("/seam/resource" + fullPath); dispatcher.forward(request, response); } else { chain.doFilter(request, response); } } }
And the exception i'm getting being triggered from a
@Restrict("#{s:hasRole('api')"})
attached to the class.
15:03:54,991 ERROR [[Seam Resource Servlet]] Servlet.service() for servlet Seam Resource Servlet threw exception org.jboss.seam.security.NotLoggedInException at org.jboss.seam.security.Identity.checkRestriction(Identity.java:217)