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 | Field and Description |
|---|---|
static com.google.inject.Key<AnonymousFilter> |
ANON |
static com.google.inject.Key<FormAuthenticationFilter> |
AUTHC |
static com.google.inject.Key<BasicHttpAuthenticationFilter> |
AUTHC_BASIC |
static com.google.inject.Key<LogoutFilter> |
LOGOUT |
static com.google.inject.Key<NoSessionCreationFilter> |
NO_SESSION_CREATION |
static com.google.inject.Key<PermissionsAuthorizationFilter> |
PERMS |
static com.google.inject.Key<PortFilter> |
PORT |
static com.google.inject.Key<HttpMethodPermissionFilter> |
REST |
static com.google.inject.Key<RolesAuthorizationFilter> |
ROLES |
static com.google.inject.Key<SslFilter> |
SSL |
static com.google.inject.Key<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)
Adds a filter chain to the shiro configuration.
|
protected void |
bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<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 SecurityManager> bind)
Binds the security manager.
|
protected void |
bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<SessionManager> bind)
Binds the session manager.
|
protected void |
bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super WebEnvironment> bind) |
protected void |
bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super WebSecurityManager> bind)
Binds the security manager.
|
protected static <T extends PathMatchingFilter> |
config(Class<T> type,
String configValue) |
protected static <T extends PathMatchingFilter> |
config(com.google.inject.Key<T> baseKey,
String configValue) |
protected static <T extends PathMatchingFilter> |
config(com.google.inject.TypeLiteral<T> typeLiteral,
String configValue) |
protected void |
configureShiro()
Implement this method in order to configure your realms and any other Shiro customization you may need.
|
protected abstract void |
configureShiroWeb() |
static com.google.inject.servlet.ServletModule |
guiceFilterModule() |
static com.google.inject.servlet.ServletModule |
guiceFilterModule(String pattern) |
add, bindBeanType, 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<AnonymousFilter> ANON
public static final com.google.inject.Key<FormAuthenticationFilter> AUTHC
public static final com.google.inject.Key<BasicHttpAuthenticationFilter> AUTHC_BASIC
public static final com.google.inject.Key<NoSessionCreationFilter> NO_SESSION_CREATION
public static final com.google.inject.Key<LogoutFilter> LOGOUT
public static final com.google.inject.Key<PermissionsAuthorizationFilter> PERMS
public static final com.google.inject.Key<PortFilter> PORT
public static final com.google.inject.Key<HttpMethodPermissionFilter> REST
public static final com.google.inject.Key<RolesAuthorizationFilter> ROLES
public static final com.google.inject.Key<SslFilter> SSL
public static final com.google.inject.Key<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 SecurityManager> bind)
ShiroModuleDefaultSecurityManager is bound as an eager singleton.bindSecurityManager in class ShiroModuleprotected void bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super WebSecurityManager> bind)
DefaultWebSecurityManager is bound as an eager singleton.bind - protected void bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<SessionManager> bind)
DefaultWebSessionManager is bound as an eager singleton.bindSessionManager in class ShiroModulebind - protected final void bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<Environment> bind)
ShiroModuleGuiceEnvironment is bound as an eager singleton.bindEnvironment in class ShiroModuleprotected void bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super WebEnvironment> bind)
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 - protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.Key<T> baseKey, String configValue)
protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.TypeLiteral<T> typeLiteral, String configValue)
protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(Class<T> type, String configValue)
Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.