View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.shiro.spring.web.config;
20  
21  import org.apache.shiro.authc.Authenticator;
22  import org.apache.shiro.authc.pam.AuthenticationStrategy;
23  import org.apache.shiro.authz.Authorizer;
24  import org.apache.shiro.mgt.*;
25  import org.apache.shiro.realm.Realm;
26  import org.apache.shiro.session.mgt.SessionFactory;
27  import org.apache.shiro.session.mgt.SessionManager;
28  import org.apache.shiro.session.mgt.eis.SessionDAO;
29  import org.apache.shiro.web.servlet.Cookie;
30  import org.springframework.context.annotation.Bean;
31  import org.springframework.context.annotation.Configuration;
32  import org.springframework.context.annotation.DependsOn;
33  
34  import java.util.List;
35  
36  /**
37   * @since 1.4.0
38   */
39  @Configuration
40  public class ShiroWebConfiguration extends AbstractShiroWebConfiguration {
41  
42      @Bean
43      @Override
44      protected SubjectDAO subjectDAO() {
45          return super.subjectDAO();
46      }
47  
48      @Bean
49      @Override
50      protected SessionStorageEvaluator sessionStorageEvaluator() {
51          return super.sessionStorageEvaluator();
52      }
53  
54      @Bean
55      @Override
56      protected SessionFactory sessionFactory() {
57          return super.sessionFactory();
58      }
59  
60      @Bean
61      @Override
62      protected SessionDAO sessionDAO() {
63          return super.sessionDAO();
64      }
65  
66      @Bean(name = "sessionCookieTemplate")
67      @Override
68      protected Cookie sessionCookieTemplate() {
69          return super.sessionCookieTemplate();
70      }
71  
72      @Bean(name = "rememberMeCookieTemplate")
73      @Override
74      protected Cookie rememberMeCookieTemplate() {
75          return super.rememberMeCookieTemplate();
76      }
77  
78      @Bean
79      @Override
80      protected RememberMeManager rememberMeManager() {
81          return super.rememberMeManager();
82      }
83  
84      @Bean
85      @Override
86      protected SubjectFactory subjectFactory() {
87          return super.subjectFactory();
88      }
89  
90      @Bean
91      @Override
92      protected Authorizer authorizer() {
93          return super.authorizer();
94      }
95  
96      @Bean
97      @Override
98      protected AuthenticationStrategy authenticationStrategy() {
99          return super.authenticationStrategy();
100     }
101 
102     @Bean
103     @Override
104     protected Authenticator authenticator() {
105         return super.authenticator();
106     }
107 
108     @Bean
109     @Override
110     protected SessionManager sessionManager() {
111         return super.sessionManager();
112     }
113 
114     @Bean
115     @Override
116     protected SessionsSecurityManager securityManager(List<Realm> realms) {
117         return super.securityManager(realms);
118     }
119 
120     @Bean
121     @Override
122     protected ShiroFilterChainDefinition shiroFilterChainDefinition() {
123         return super.shiroFilterChainDefinition();
124     }
125 }