Search code examples
javarestjax-rsshirodropwizard

Integrate Apache Shiro Security Library with Dropwizard based JAX-RS application


I am trying to change Dropwizard to support Shiro.

I have read documentation and am little puzzled. I would like to utilize Shiro in conjunction with form login authentication and Apache Shiro Annotations. I think that I need to use Jersey Filters to support Shiro.

Is this the correct way to support Shiro annotations at Jersey instead of classic Shiro Filter approach?

Since Jersey Filters have decent access to resources with annotations, it seems perfect for me to use annotations.

I rather not use the AOP approach, and It could be really great to have on the fly integration with JAX-RS as a separated module.


Solution

  • Someone has already created a solution for what you are asking.

    Shiro with Jersey.

    https://github.com/javajack/shiro-jersey

    Shiro For Dropwizard https://github.com/javajack/shiro-jdbi-realm

    Dropwizard Shiro Budle Example https://github.com/javajack/dw-shiro-bundle