1- <beans xmlns =" http://www.springframework.org/schema/beans"
2- xmlns : security =" http://www.springframework.org/schema/security"
3- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4- xsi : schemaLocation =" http://www.springframework.org/schema/beans
5- http://www.springframework.org/schema/beans/spring-beans.xsd
6- http://www.springframework.org/schema/security
7- http://www.springframework.org/schema/security/spring-security.xsd" >
8-
9- <!-- authentication manager and its provider( social provider deals with social login & local user provider deals with form login ) -->
10- <security : authentication-manager alias =" authenticationManager" >
11- <security : authentication-provider ref =" socialAuthenticationProvider" />
12- <security : authentication-provider user-service-ref =" localUserDetailService" />
13- </security : authentication-manager >
14-
15- <bean id =" socialAuthenticationProvider" class =" org.springframework.social.security.SocialAuthenticationProvider" >
16- <constructor-arg ref =" inMemoryUsersConnectionRepository" />
17- <constructor-arg ref =" socialUserDetailService" />
18- </bean >
19-
20- <!-- form login beans -->
21- <bean id =" appAuthenticationEntryPoint" class =" egovframework.com.ext.jstree.support.security.entrypoint.AppAuthenticationEntryPoint" >
22- <constructor-arg name =" loginFormUrl" value =" /services/login" />
23- </bean >
24- <bean id =" rememberMeServices" class =" org.springframework.security.web.authentication.NullRememberMeServices" />
25- <bean id =" successHandler" class =" egovframework.com.ext.jstree.support.security.handler.AppSuccessHandler" />
26- <bean id =" failureHandler" class =" org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" >
27- <constructor-arg name =" defaultFailureUrl" value =" /services/accessdenied" />
28- </bean >
29- <bean id =" logoutFilter" class =" org.springframework.security.web.authentication.logout.LogoutFilter" >
30- <constructor-arg name =" logoutSuccessHandler" ref =" logoutSuccessHandler" />
31- <constructor-arg name =" handlers" >
32- <list >
33- <bean name =" securityContextLogoutHandler" class =" org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
34- </list >
35- </constructor-arg >
36- </bean >
37-
38- <bean id =" logoutSuccessHandler" class =" org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler" />
39- <bean class =" org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" id =" SecurityAuthFilter" >
40- <property name =" authenticationManager" ref =" authenticationManager" />
41- <property name =" authenticationSuccessHandler" ref =" successHandler" />
42- <property name =" authenticationFailureHandler" ref =" failureHandler" />
43- <property name =" filterProcessesUrl" value =" /j_spring_security_check" />
44- <property name =" rememberMeServices" ref =" rememberMeServices" />
45- </bean >
46-
47-
48- <!-- Anyone can access these urls -->
1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <beans xmlns =" http://www.springframework.org/schema/beans" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xmlns:egov-security=" http://www.egovframe.go.kr/schema/egov-security"
4+ xmlns:security=" http://www.springframework.org/schema/security"
5+ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
6+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
7+ http://www.egovframe.go.kr/schema/egov-security http://www.egovframe.go.kr/schema/egov-security/egov-security-3.0.xsd" >
8+
9+ <!--
10+ 수정일 수정자 수정내용
11+ ========= ======= =================================================
12+ 2011.09.07 서준식 일반, 업무사용자의 경우 조직아이디가 없어 로그인이 안되던 문제 수정(SQL 수정)
13+ 2011.09.25 서준식 usersByUsernameQuery 쿼리의 조직 아이디 비교 부분 오류 수정 > alias 추가
14+ 2014.06.13 Vincent Han 표준프레임워크 3.0 적용 (간소화 설정 사용)
15+ -->
16+
17+ <security : http pattern =" /css/**" security =" none" />
18+ <security : http pattern =" /html/**" security =" none" />
4919 <security : http pattern =" /images/**" security =" none" />
50- <security : http pattern =" /services/login" security =" none" />
51- <security : http pattern =" /services/accessdenied" security =" none" />
52- <security : http pattern =" /services/signup" security =" none" />
53- <security : http pattern =" /services/user/register" security =" none" />
54-
55- <security : http use-expressions =" true" entry-point-ref =" appAuthenticationEntryPoint" >
56-
57- <security : intercept-url pattern =" /auth/**" access =" permitAll" />
58- <security : intercept-url pattern =" /j_spring_security_check" access =" permitAll" />
59-
60- <security : intercept-url pattern =" /" access =" isAuthenticated()" />
61- <security : intercept-url pattern =" /**" access =" isAuthenticated()" />
62-
63- <!-- Adds social authentication filter to the Spring Security filter chain. -->
64- <security : custom-filter before =" PRE_AUTH_FILTER" ref =" socialAuthenticationFilter" />
65- <security : custom-filter position =" FORM_LOGIN_FILTER" ref =" SecurityAuthFilter" />
66- <security : custom-filter position =" LOGOUT_FILTER" ref =" logoutFilter" />
67- </security : http >
68-
69- <!-- social login filter which is a pre authentication filter and works for /auth service url -->
70- <bean id =" socialAuthenticationFilter" class =" org.springframework.social.security.SocialAuthenticationFilter" >
71- <constructor-arg name =" authManager" ref =" authenticationManager" />
72- <constructor-arg name =" userIdSource" ref =" userIdSource" />
73- <constructor-arg name =" usersConnectionRepository" ref =" inMemoryUsersConnectionRepository" />
74- <constructor-arg name =" authServiceLocator" ref =" appSocialAuthenticationServiceRegistry" />
75- <property name =" authenticationSuccessHandler" ref =" successHandler" />
76- </bean >
77-
78-
79- <!-- inmemory connection repository which holds connection repository per local user -->
80- <bean id =" inMemoryUsersConnectionRepository"
81- class =" org.springframework.social.connect.mem.InMemoryUsersConnectionRepository" >
82- <constructor-arg name =" connectionFactoryLocator" ref =" appSocialAuthenticationServiceRegistry" />
83- <property name =" connectionSignUp" ref =" connectionSignUp" />
84- </bean >
85-
86- <!-- service registry will holds connection factory of each social provider -->
87- <bean id =" appSocialAuthenticationServiceRegistry"
88- class =" egovframework.com.ext.jstree.support.security.registry.AppSocialAuthenticationServiceRegistry" >
89- <constructor-arg >
90- <list >
91- <ref bean =" facebookAuthenticationService" />
92- <ref bean =" twitterAuthenticationService" />
93- <ref bean =" linkedInAuthenticationService" />
94- <ref bean =" googleAuthenticationService" />
95- </list >
96- </constructor-arg >
97- </bean >
98-
99- <bean id =" facebookAuthenticationService"
100- class =" org.springframework.social.facebook.security.FacebookAuthenticationService" >
101- <constructor-arg name =" apiKey" value =" ${facebook.api.key}" />
102- <constructor-arg name =" appSecret" value =" ${facebook.api.secret}" />
103- </bean >
104-
105- <bean id =" twitterAuthenticationService"
106- class =" org.springframework.social.twitter.security.TwitterAuthenticationService" >
107- <constructor-arg name =" apiKey" value =" ${twitter.api.key}" />
108- <constructor-arg name =" appSecret" value =" ${twitter.api.secret}" />
109- </bean >
110-
111- <bean id =" linkedInAuthenticationService"
112- class =" org.springframework.social.linkedin.security.LinkedInAuthenticationService" >
113- <constructor-arg name =" apiKey" value =" ${linkedin.api.key}" />
114- <constructor-arg name =" appSecret" value =" ${linkedin.api.secret}" />
115- </bean >
116-
117- <bean id =" googleAuthenticationService"
118- class =" org.springframework.social.google.security.GoogleAuthenticationService" >
119- <constructor-arg name =" apiKey" value =" ${google.api.key}" />
120- <constructor-arg name =" appSecret" value =" ${google.api.secret}" />
121- </bean >
122-
123- <bean id =" userIdSource" class =" org.springframework.social.security.AuthenticationNameUserIdSource" />
124-
125- <!-- If no local user is associated to a social connection then connection sign up will create a new local user and map it to social user -->
126- <bean id =" connectionSignUp" class =" egovframework.com.ext.jstree.support.security.registry.AppConnectionSignUp" />
127- </beans >
20+ <security : http pattern =" /js/**" security =" none" />
21+ <security : http pattern =" /resource/**" security =" none" />
22+ <security : http pattern =" \A/WEB-INF/jsp/.*\Z" request-matcher =" regex" security =" none" />
23+
24+ <egov-security : config id =" securityConfig"
25+ loginUrl=" /uat/uia/egovLoginUsr.do"
26+ logoutSuccessUrl=" /uat/uia/actionLogout.do"
27+ loginFailureUrl=" /uat/uia/egovLoginUsr.do?login_error=1"
28+ accessDeniedUrl=" /sec/ram/accessDenied.do"
29+
30+ dataSource=" egov.dataSource"
31+ jdbcUsersByUsernameQuery=" SELECT USER_ID, ESNTL_ID AS PASSWORD, 1 ENABLED, USER_NM, USER_ZIP,
32+ USER_ADRES, USER_EMAIL, USER_SE, ORGNZT_ID, ESNTL_ID,
33+ (select a.ORGNZT_NM from COMTNORGNZTINFO a where a.ORGNZT_ID = m.ORGNZT_ID) ORGNZT_NM
34+ FROM COMVNUSERMASTER m WHERE CONCAT(USER_SE, USER_ID) = ?"
35+ jdbcAuthoritiesByUsernameQuery=" SELECT A.SCRTY_DTRMN_TRGET_ID USER_ID, A.AUTHOR_CODE AUTHORITY
36+ FROM COMTNEMPLYRSCRTYESTBS A, COMVNUSERMASTER B
37+ WHERE A.SCRTY_DTRMN_TRGET_ID = B.ESNTL_ID AND B.USER_ID = ?"
38+ jdbcMapClass=" egovframework.com.sec.security.common.EgovSessionMapping"
39+
40+ requestMatcherType=" regex"
41+ hash=" plaintext"
42+ hashBase64=" false"
43+
44+ concurrentMaxSessons=" 1"
45+ concurrentExpiredUrl=" /EgovContent.do"
46+
47+ defaultTargetUrl=" /egovIndex.do"
48+ />
49+
50+ <egov-security : secured-object-config id =" securedObjectConfig"
51+ sqlHierarchicalRoles="
52+ SELECT a.CHLDRN_ROLE child, a.PARNTS_ROLE parent
53+ FROM COMTNROLES_HIERARCHY a LEFT JOIN COMTNROLES_HIERARCHY b on (a.CHLDRN_ROLE = b.PARNTS_ROLE)"
54+ sqlRolesAndUrl="
55+ SELECT a.ROLE_PTTRN url, b.AUTHOR_CODE authority
56+ FROM COMTNROLEINFO a, COMTNAUTHORROLERELATE b
57+ WHERE a.ROLE_CODE = b.ROLE_CODE
58+ AND a.ROLE_TY = 'url' ORDER BY a.ROLE_SORT"
59+ sqlRolesAndMethod="
60+ SELECT a.ROLE_PTTRN method, b.AUTHOR_CODE authority
61+ FROM COMTNROLEINFO a, COMTNAUTHORROLERELATE b
62+ WHERE a.ROLE_CODE = b.ROLE_CODE
63+ AND a.ROLE_TY = 'method' ORDER BY a.ROLE_SORT"
64+ sqlRolesAndPointcut="
65+ SELECT a.ROLE_PTTRN pointcut, b.AUTHOR_CODE authority
66+ FROM COMTNROLEINFO a, COMTNAUTHORROLERELATE b
67+ WHERE a.ROLE_CODE = b.ROLE_CODE
68+ AND a.ROLE_TY = 'pointcut' ORDER BY a.ROLE_SORT"
69+ sqlRegexMatchedRequestMapping="
70+ SELECT a.resource_pattern uri, b.authority authority
71+ FROM COMTNSECURED_RESOURCES a, COMTNSECURED_RESOURCES_ROLE b
72+ WHERE a.resource_id = b.resource_id
73+ AND a.resource_type = 'url'"
74+ />
75+
76+ <egov-security : initializer id =" initializer" supportMethod =" true" supportPointcut =" false" />
77+
78+ </beans >
0 commit comments