public abstract class ShiroWebModule extends ShiroModule
WebSecurityManager, SecurityManager and SessionManager. At least one realm must be added by
using bindRealm.
Also provides for the configuring of filter chains and binds a FilterChainResolver with that information.| Modifier and Type | Class and Description |
|---|---|
static class |
ShiroWebModule.FilterConfig<T extends javax.servlet.Filter>
Filter configuration which pairs a Filter class with its configuration used on a path.
|
| Modifier and Type | Field and Description |
|---|---|
static com.google.inject.Key<org.apache.shiro.web.filter.authc.AnonymousFilter> |
ANON |
static com.google.inject.Key<org.apache.shiro.web.filter.authc.FormAuthenticationFilter> |
AUTHC |
static com.google.inject.Key<org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter> |
AUTHC_BASIC |
static com.google.inject.Key<org.apache.shiro.web.filter.authc.LogoutFilter> |
LOGOUT |
static com.google.inject.Key<org.apache.shiro.web.filter.session.NoSessionCreationFilter> |
NO_SESSION_CREATION |
static com.google.inject.Key<org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter> |
PERMS |
static com.google.inject.Key<org.apache.shiro.web.filter.authz.PortFilter> |
PORT |
static com.google.inject.Key<org.apache.shiro.web.filter.authz.HttpMethodPermissionFilter> |
REST |
static com.google.inject.Key<org.apache.shiro.web.filter.authz.RolesAuthorizationFilter> |
ROLES |
static com.google.inject.Key<org.apache.shiro.web.filter.authz.SslFilter> |
SSL |
static com.google.inject.Key<org.apache.shiro.web.filter.authc.UserFilter> |
USER |
| Constructor and Description |
|---|
ShiroWebModule(javax.servlet.ServletContext servletContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFilterChain(String pattern,
com.google.inject.Key<? extends javax.servlet.Filter>... keys)
Deprecated.
|
protected void |
addFilterChain(String pattern,
com.google.inject.Key<? extends javax.servlet.Filter> key) |
protected void |
addFilterChain(String pattern,
ShiroWebModule.FilterConfig<? extends javax.servlet.Filter>... filterConfigs)
Maps 'n' number of
filterConfigs to a specific path pattern. |
protected void |
bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.env.Environment> bind)
Binds the environment.
|
static void |
bindGuiceFilter(com.google.inject.Binder binder) |
static void |
bindGuiceFilter(String pattern,
com.google.inject.Binder binder) |
protected void |
bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.mgt.SecurityManager> bind)
Binds the security manager.
|
protected void |
bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.session.mgt.SessionManager> bind)
Binds the session manager.
|
protected void |
bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.web.env.WebEnvironment> bind) |
protected void |
bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.web.mgt.WebSecurityManager> bind)
Binds the security manager.
|
protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> |
config(Class<T> type,
String configValue)
Deprecated.
|
protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> |
config(com.google.inject.Key<T> baseKey,
String configValue)
Deprecated.
|
protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> |
config(com.google.inject.TypeLiteral<T> typeLiteral,
String configValue)
Deprecated.
|
protected void |
configureShiro()
Implement this method in order to configure your realms and any other Shiro customization you may need.
|
protected abstract void |
configureShiroWeb() |
protected static <T extends javax.servlet.Filter> |
filterConfig(Class<T> type,
String configValue)
Builds a FilterConfig from a Filer and configuration String
|
protected static <T extends javax.servlet.Filter> |
filterConfig(com.google.inject.Key<T> baseKey)
Builds a FilterConfig from a Filer and configuration String
|
protected static <T extends javax.servlet.Filter> |
filterConfig(com.google.inject.Key<T> baseKey,
String configValue)
Builds a FilterConfig from a Filer and configuration String
|
protected static <T extends javax.servlet.Filter> |
filterConfig(com.google.inject.TypeLiteral<T> typeLiteral,
String configValue)
Builds a FilterConfig from a Filer and configuration String
|
static com.google.inject.servlet.ServletModule |
guiceFilterModule() |
static com.google.inject.servlet.ServletModule |
guiceFilterModule(String pattern) |
add, bindBeanType, bindEventBus, bindRealm, configure, destroyaddError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, expose, expose, expose, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingpublic static final com.google.inject.Key<org.apache.shiro.web.filter.authc.AnonymousFilter> ANON
public static final com.google.inject.Key<org.apache.shiro.web.filter.authc.FormAuthenticationFilter> AUTHC
public static final com.google.inject.Key<org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter> AUTHC_BASIC
public static final com.google.inject.Key<org.apache.shiro.web.filter.session.NoSessionCreationFilter> NO_SESSION_CREATION
public static final com.google.inject.Key<org.apache.shiro.web.filter.authc.LogoutFilter> LOGOUT
public static final com.google.inject.Key<org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter> PERMS
public static final com.google.inject.Key<org.apache.shiro.web.filter.authz.PortFilter> PORT
public static final com.google.inject.Key<org.apache.shiro.web.filter.authz.HttpMethodPermissionFilter> REST
public static final com.google.inject.Key<org.apache.shiro.web.filter.authz.RolesAuthorizationFilter> ROLES
public static final com.google.inject.Key<org.apache.shiro.web.filter.authz.SslFilter> SSL
public static final com.google.inject.Key<org.apache.shiro.web.filter.authc.UserFilter> USER
public ShiroWebModule(javax.servlet.ServletContext servletContext)
public static void bindGuiceFilter(com.google.inject.Binder binder)
public static void bindGuiceFilter(String pattern, com.google.inject.Binder binder)
public static com.google.inject.servlet.ServletModule guiceFilterModule()
public static com.google.inject.servlet.ServletModule guiceFilterModule(String pattern)
protected final void configureShiro()
ShiroModuleconfigureShiro in class ShiroModuleprotected abstract void configureShiroWeb()
protected final void bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.mgt.SecurityManager> bind)
ShiroModuleDefaultSecurityManager is bound as an eager singleton.bindSecurityManager in class ShiroModuleprotected void bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.web.mgt.WebSecurityManager> bind)
DefaultWebSecurityManager is bound as an eager singleton.bind - protected void bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.session.mgt.SessionManager> bind)
DefaultWebSessionManager is bound as an eager singleton.bindSessionManager in class ShiroModulebind - protected final void bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.env.Environment> bind)
ShiroModuleGuiceEnvironment is bound as an eager singleton.bindEnvironment in class ShiroModuleprotected void bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.web.env.WebEnvironment> bind)
protected final void addFilterChain(String pattern, com.google.inject.Key<? extends javax.servlet.Filter> key)
protected final void addFilterChain(String pattern, ShiroWebModule.FilterConfig<? extends javax.servlet.Filter>... filterConfigs)
filterConfigs to a specific path pattern.FormAuthenticationFilter.pattern - URL patter to be mapped to a FilterConfig, e.g. '/my_private-path/**'filterConfigs - FilterConfiguration representing the Filter and config to be used when processing resources on pattern.protected static <T extends javax.servlet.Filter> ShiroWebModule.FilterConfig<T> filterConfig(com.google.inject.Key<T> baseKey, String configValue)
T - A Servlet Filter class.baseKey - The Key of the Filter class to be used.protected static <T extends javax.servlet.Filter> ShiroWebModule.FilterConfig<T> filterConfig(com.google.inject.Key<T> baseKey)
T - A Servlet Filter class.baseKey - The Key of the Filter class to be used.protected static <T extends javax.servlet.Filter> ShiroWebModule.FilterConfig<T> filterConfig(com.google.inject.TypeLiteral<T> typeLiteral, String configValue)
T - A Servlet Filter class.typeLiteral - The TyleLiteral of the filter key to be used.configValue - the configuration used.protected static <T extends javax.servlet.Filter> ShiroWebModule.FilterConfig<T> filterConfig(Class<T> type, String configValue)
T - A Servlet Filter class.type - The filter to be used.configValue - the configuration used.@Deprecated protected final void addFilterChain(String pattern, com.google.inject.Key<? extends javax.servlet.Filter>... keys)
PathMatchingFilter, it will be registered with a proper
provider.pattern - keys - @Deprecated protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.Key<T> baseKey, String configValue)
@Deprecated protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.TypeLiteral<T> typeLiteral, String configValue)
@Deprecated protected static <T extends org.apache.shiro.web.filter.PathMatchingFilter> com.google.inject.Key<T> config(Class<T> type, String configValue)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.