001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.shiro.spring.web.config; 020 021import org.apache.shiro.authc.Authenticator; 022import org.apache.shiro.authc.pam.AuthenticationStrategy; 023import org.apache.shiro.authz.Authorizer; 024import org.apache.shiro.mgt.RememberMeManager; 025import org.apache.shiro.mgt.SessionStorageEvaluator; 026import org.apache.shiro.mgt.SessionsSecurityManager; 027import org.apache.shiro.mgt.SubjectDAO; 028import org.apache.shiro.mgt.SubjectFactory; 029import org.apache.shiro.realm.Realm; 030import org.apache.shiro.session.mgt.SessionFactory; 031import org.apache.shiro.session.mgt.SessionManager; 032import org.apache.shiro.session.mgt.eis.SessionDAO; 033import org.apache.shiro.spring.web.ShiroUrlPathHelper; 034import org.apache.shiro.web.servlet.Cookie; 035import org.springframework.context.annotation.Bean; 036import org.springframework.context.annotation.Configuration; 037 038import java.util.List; 039 040/** 041 * @since 1.4.0 042 */ 043@Configuration 044public class ShiroWebConfiguration extends AbstractShiroWebConfiguration { 045 046 @Bean 047 @Override 048 protected SubjectDAO subjectDAO() { 049 return super.subjectDAO(); 050 } 051 052 @Bean 053 @Override 054 protected SessionStorageEvaluator sessionStorageEvaluator() { 055 return super.sessionStorageEvaluator(); 056 } 057 058 @Bean 059 @Override 060 protected SessionFactory sessionFactory() { 061 return super.sessionFactory(); 062 } 063 064 @Bean 065 @Override 066 protected SessionDAO sessionDAO() { 067 return super.sessionDAO(); 068 } 069 070 @Bean(name = "sessionCookieTemplate") 071 @Override 072 protected Cookie sessionCookieTemplate() { 073 return super.sessionCookieTemplate(); 074 } 075 076 @Bean(name = "rememberMeCookieTemplate") 077 @Override 078 protected Cookie rememberMeCookieTemplate() { 079 return super.rememberMeCookieTemplate(); 080 } 081 082 @Bean 083 @Override 084 protected RememberMeManager rememberMeManager() { 085 return super.rememberMeManager(); 086 } 087 088 @Bean 089 @Override 090 protected SubjectFactory subjectFactory() { 091 return super.subjectFactory(); 092 } 093 094 @Bean 095 @Override 096 protected Authorizer authorizer() { 097 return super.authorizer(); 098 } 099 100 @Bean 101 @Override 102 protected AuthenticationStrategy authenticationStrategy() { 103 return super.authenticationStrategy(); 104 } 105 106 @Bean 107 @Override 108 protected Authenticator authenticator() { 109 return super.authenticator(); 110 } 111 112 @Bean 113 @Override 114 protected SessionManager sessionManager() { 115 return super.sessionManager(); 116 } 117 118 @Bean 119 @Override 120 protected SessionsSecurityManager securityManager(List<Realm> realms) { 121 return super.securityManager(realms); 122 } 123 124 @Bean 125 @Override 126 protected ShiroFilterChainDefinition shiroFilterChainDefinition() { 127 return super.shiroFilterChainDefinition(); 128 } 129 130 @Bean 131 @Override 132 protected ShiroUrlPathHelper shiroUrlPathHelper() { 133 return super.shiroUrlPathHelper(); 134 } 135}