<div>
                    Great gist my friend! I was wondering about another alternative more simple. Currently AeroGear security implements HttpStatusAwareException (I'll rename to HttpStatusAware and qmx is responsible for the hipster name)
                </div><div><br></div><div><div>public class AeroGearSecurityMeh implements HttpStatusAware {</div><div><br></div><div>&nbsp; &nbsp; @Override</div><div>&nbsp; &nbsp; public int getStatus() {</div><div>&nbsp; &nbsp; &nbsp; //something here</div><div>&nbsp; &nbsp;&nbsp;}</div><div><br></div><div>&nbsp; &nbsp; @Override</div><div>&nbsp; &nbsp; public String getMessage() {</div><div>&nbsp; &nbsp; &nbsp; //something here</div><div>&nbsp; &nbsp;&nbsp;}</div><div>}</div></div><div><br></div><div>Then in&nbsp;AeroGearSecurityProvider we could change the method return and do something like this:</div><div><br></div><div><div>public class AeroGearSecurityProvider implements SecurityProvider {</div><div><br></div><div>&nbsp; &nbsp; @Inject</div><div>&nbsp; &nbsp; private AeroGearPrincipal principal;</div><div><br></div><div>&nbsp; &nbsp; @Override</div><div>&nbsp; &nbsp; public&nbsp;AeroGearSecurityMeh&nbsp;isRouteAllowed(Route route) throws ServletException {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (!principal.hasRoles(route.getRoles())) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return new&nbsp;AeroGearSecurityMeh(1, "Geez, authentication has failed");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div></div>
                <div><div><br></div><div>Wdyt? Makes sense?</div><div><br></div><div><div>--&nbsp;</div><div>"The measure of a man is what he does with power" - Plato</div><div>-</div><div>@abstractj</div><div>-</div><div>Volenti Nihil Difficile</div></div></div>
                 
                <p style="color: #A0A0A8;">On Thursday, November 1, 2012 at 6:14 AM, Daniel Bevenius wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>Hi,</div><div><br></div><div>I'm working on AEROGEAR-581 and have put together some background</div><div>information and some prototype code in this gist:</div><div><a href="https://gist.github.com/3992369">https://gist.github.com/3992369</a></div><div><br></div><div>If you read the conclusion section you'll see that I'm not convinced</div><div>that CDI events are a good fit in this specific situation, but I'd be</div><div>happy to learn otherwise :)</div><div><br></div><div>Thanks,</div><div><br></div><div>/Dan</div><div>_______________________________________________</div><div>aerogear-dev mailing list</div><div><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></div><div><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>