Search in sources :

Example 1 with SubjectFactory

use of org.secnod.shiro.jersey.SubjectFactory in project dropwizard-shiro by silb.

the class ShiroBundle method run.

@Override
public void run(T configuration, Environment environment) {
    ShiroConfiguration shiroConfig = narrow(configuration);
    ResourceConfig resourceConfig = environment.jersey().getResourceConfig();
    resourceConfig.register(new AuthorizationFilterFeature());
    resourceConfig.register(new SubjectFactory());
    resourceConfig.register(new AuthInjectionBinder());
    Filter shiroFilter = createFilter(configuration);
    environment.servlets().addFilter("ShiroFilter", shiroFilter).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, shiroConfig.filterUrlPattern());
}
Also used : SubjectFactory(org.secnod.shiro.jersey.SubjectFactory) AuthorizationFilterFeature(org.secnod.shiro.jersey.AuthorizationFilterFeature) AbstractShiroFilter(org.apache.shiro.web.servlet.AbstractShiroFilter) Filter(javax.servlet.Filter) AuthInjectionBinder(org.secnod.shiro.jersey.AuthInjectionBinder) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) DispatcherType(javax.servlet.DispatcherType)

Aggregations

DispatcherType (javax.servlet.DispatcherType)1 Filter (javax.servlet.Filter)1 AbstractShiroFilter (org.apache.shiro.web.servlet.AbstractShiroFilter)1 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)1 AuthInjectionBinder (org.secnod.shiro.jersey.AuthInjectionBinder)1 AuthorizationFilterFeature (org.secnod.shiro.jersey.AuthorizationFilterFeature)1 SubjectFactory (org.secnod.shiro.jersey.SubjectFactory)1