app-security.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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-3.0.xsd
  6. http://www.springframework.org/schema/security
  7. http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  8. <security:http pattern=" /platform/system/sysFile/file_*.ht" security="none" />
  9. <security:http pattern=" /platform/bpm/task/toStart.ht?**" security="none" />
  10. <security:http pattern="/js/**" security="none" />
  11. <security:http pattern="/commons/**" security="none" />
  12. <security:http pattern="/media/**" security="none" />
  13. <security:http pattern="/403*" security="none" />
  14. <security:http pattern="/404*" security="none" />
  15. <security:http pattern="/500*" security="none" />
  16. <security:http pattern="/weixin/assets/**" security="none" />
  17. <security:http pattern="/servlet/ValidCode" security="none" />
  18. <security:http entry-point-ref="multipleAuthenticationLoginEntry"
  19. servlet-api-provision="true">
  20. <!-- <security:session-management invalid-session-url="/loginRedirect.ht">
  21. <security:concurrency-control error-if-maximum-exceeded="false" max-sessions="1"
  22. expired-url="/loginRedirect.ht"/> </security:session-management> -->
  23. <!--使用表单登录 -->
  24. <security:remember-me key="bpm3PrivateKey" />
  25. <security:logout logout-url="/logout"
  26. logout-success-url="/loginRedirect.ht" />
  27. <security:custom-filter ref="aopFilter" after="FORM_LOGIN_FILTER" />
  28. <security:custom-filter before="FILTER_SECURITY_INTERCEPTOR"
  29. ref="permissionFilter" />
  30. <security:access-denied-handler ref="htAccessDeniedHandler" />
  31. <security:custom-filter position="SWITCH_USER_FILTER"
  32. ref="switchUserProcessingFilter" />
  33. </security:http>
  34. <bean id="actionPageMap" class="java.util.HashMap">
  35. <constructor-arg>
  36. <map>
  37. <entry key="mobile" value="/mobileLogin.jsp"></entry>
  38. </map>
  39. </constructor-arg>
  40. </bean>
  41. <bean id="switchUserProcessingFilter" class="com.hotent.core.web.filter.HtSwitchUserFilter">
  42. <property name="userDetailsService" ref="sysUserDao" />
  43. <property name="switchUserUrl" value="/j_spring_security_switch_user" />
  44. <property name="exitUserUrl" value="/j_spring_security_exit_user" />
  45. <property name="targetUrl" value="/platform/console/main.ht" />
  46. </bean>
  47. <!--登录入口定义 -->
  48. <bean id="multipleAuthenticationLoginEntry"
  49. class="com.hotent.platform.web.filter.MultipleAuthenticationLoginEntry">
  50. <property name="defaultLoginUrl" value="/login.jsp" />
  51. <property name="directUrlResolvers">
  52. <list>
  53. <ref bean="mobileLoginEntry" />
  54. <ref bean="weixinLoginEntry" />
  55. </list>
  56. </property>
  57. </bean>
  58. <!-- 跳转到手机登陆页 -->
  59. <bean id="mobileLoginEntry"
  60. class="com.hotent.platform.web.filter.RequestUriDirectUrlResolver">
  61. <property name="pattern" value="/mobile" />
  62. <property name="directUrl" value="/mobileLogin.jsp" />
  63. </bean>
  64. <bean id="weixinLoginEntry"
  65. class="com.hotent.platform.web.filter.RequestUriDirectUrlResolver">
  66. <property name="pattern" value="/weixin" />
  67. <property name="directUrl" value="/weixin/login.html" />
  68. </bean>
  69. <bean id="htAccessDeniedHandler" class="com.hotent.platform.web.filter.HtAccessDeniedHandler">
  70. <property name="accessDeniedUrl" value="/commons/403.jsp"></property>
  71. </bean>
  72. <!-- 认证管理器,实现用户认证的入口,主要实现UserDetailsService接口即可 -->
  73. <security:authentication-manager alias="authenticationManager">
  74. <security:authentication-provider
  75. user-service-ref="sysUserDao">
  76. <security:password-encoder ref="passwordEncoder" />
  77. </security:authentication-provider>
  78. </security:authentication-manager>
  79. <bean id="passwordEncoder" class="com.hotent.platform.web.security.CustomPwdEncoder"></bean>
  80. <bean id="aopFilter" class="com.hotent.core.web.filter.AopFilter"></bean>
  81. <!-- 一个自定义的filter,必须包含authenticationManager,accessDecisionManager,securityMetadataSource三个属性,我们的所有控制将在这三个类中实现 -->
  82. <bean id="permissionFilter" class="com.hotent.core.web.filter.PermissionFilter">
  83. <property name="authenticationManager" ref="authenticationManager" />
  84. <property name="accessDecisionManager" ref="accessDecisionManager" />
  85. <property name="securityMetadataSource" ref="securityMetadataSource" />
  86. </bean>
  87. <!-- 访问决策器,决定某个用户具有的角色,是否有足够的权限去访问某个资源 -->
  88. <bean id="accessDecisionManager" class="com.hotent.platform.web.filter.HtDecisionManager" />
  89. <!-- 资源源数据定义,即定义某一资源可以被哪些角色访问 -->
  90. <bean id="securityMetadataSource" class="com.hotent.platform.web.filter.HtSecurityMetadataSource"
  91. scope="singleton">
  92. <property name="anonymousUrls">
  93. <set>
  94. <value>/xtbg/platform/system/sysFile/getJson.ht</value>
  95. <value>/platform/</value>
  96. <value>/platform/system/sysFile/HtmlDialog.ht</value>
  97. <value>/platform/system/sysUser/get.ht</value>
  98. <value>/mobile/system/file/avatarUpload.ht</value>
  99. <value>/xtbg/platform/bpm/processRun/info.ht</value>
  100. <value>/mobileLogin.jsp</value>
  101. <value>/write/WriteFile.jsp</value>
  102. <value>/platform/bpm/bpmProCopyto/getCopyUserByInstId.ht</value>
  103. <value>/platform/system/sysUser/dialog.ht</value>
  104. <value>/platform/system/sysUserDialog.jsp</value>
  105. <value>/platform/system/sysOrg/getTreeData.ht</value>
  106. <value>/platform/system/sysOrg/dialog.ht</value>
  107. <value>/mobileLogin.jsp</value>
  108. <value>/mobileLogin.ht</value>
  109. <value>/platform/bpm/bpmTaskExe/assign.ht</value>
  110. <value>/platform/bpm/bpmTaskExe/assignSave.ht</value>
  111. <value>/platform/mobile/lang/changLang.ht</value>
  112. <value>/xtbg/platform/bpm/task/startFlow.ht</value>
  113. <value>/xtbg/platform/bpm/task/toStart.ht</value>
  114. <value>/platform/bpm/processRun/info.ht</value>
  115. <value>/xtbg/platform/system/sysUser/selector.ht</value>
  116. <value>/loginRedirect.ht</value>
  117. <value>/login.jsp</value>
  118. <value>/login.ht</value>
  119. <value>/bpmImage</value>
  120. <value>/platform/bpm/bpmProCopyto/forward.ht</value>
  121. <value>/platform/bpm/processRun/processImage.ht</value>
  122. <value>/platform/bpm/processRun/getFlowStatusByInstanceId.ht</value>
  123. <value>/platform/bpm/processRun/taskUser.ht</value>
  124. <value>/platform/bpm/taskOpinion/list.ht</value>
  125. <value>/platform/bpm/bpmTaskExe/assign.ht</value>
  126. <value>/mobile/bpm/bpmMobileTask/startFlowForm.ht
  127. </value>
  128. <value>/platform/bpm/bpmDefinition/flowImg.ht</value>
  129. <value>/platform/bpm/*</value>
  130. <value>/platform/system/sysUser/selector.ht</value>
  131. <value>/weixin/bpm/getFormPreviewData.ht
  132. </value>
  133. <value>/platform/system/sysFile/getUserData.ht
  134. </value>
  135. <value>/weixin/orgDialog/getOrgListByDim.ht
  136. </value>
  137. <value>/weixin/orgDialog/userList.ht
  138. </value>
  139. <value>/weixin/orgDialog/getDimList.ht
  140. </value>
  141. <value>/mobile/bpm/bpmMobileTask/pendingMatters.ht</value>
  142. <!-- songlin platform/bpm/task/toStart.ht -->
  143. <value>/platform/bpm/task/toStart.ht</value>
  144. <value>/platform/system/sysFile/getUserData.ht</value>
  145. <!-- 附件上传接口 宋霖20190105 ADD -->
  146. <value>/platform/file/fileManage/feedback.ht</value>
  147. <value>/platform/system/sysFile/fileUpload.ht</value>
  148. <!-- 附件列表接口 宋霖20190105 ADD -->
  149. <value>/platform/file/fileManage/fujianList.ht</value>
  150. <!-- 附件下载接口 宋霖20190105 DEL -->
  151. <value>/platform/file/fileManage/download.ht</value>
  152. <!-- 附件列表 宋霖20190105 LIST -->
  153. <value>/platform/file/fileManage/toStart.ht</value>
  154. <!-- 待办事宜列表 宋霖20190105 LIST -->
  155. <value>/platform/file/fileManage/pendingMattersList.ht</value>
  156. <value>/platform/file/fileManage/transmitComplete.ht</value>
  157. <!-- 流程审批 李梦20190228 ADD -->
  158. <value>/platform/file/fileManage/complete.ht</value>
  159. <!-- 流程审批 李梦20190228 ADD -->
  160. <value>/platform/file/fileManage/alreadyCompletedMattersList.ht</value>
  161. <value>/platform/file/fileManage/download2.ht</value>
  162. <value>/platform/system/sysOrg/dialog.ht</value>
  163. <value>/platform/system/sysUser/dialog.ht</value>
  164. <value>/platform/system/sysUser/flowDialog.ht</value>
  165. <value>/platform/system/sysUser/gradeDialog.ht</value>
  166. <value>/platform/system/sysUserDialog.jsp</value>
  167. <value>/platform/bpm/task/tranTaskUserMap.ht</value>
  168. <value>/platform/bpm/task/freeJump.ht</value>
  169. <value>/platform/bpm/taskTranTaskUserMap.jsp</value>
  170. <value>/platform/file/fileManage/SysBulletinList.ht</value>
  171. <value>/platform/file/fileManage/SysBulletinListHY.ht</value>
  172. <value>/platform/system/sysFile/contentUpload.ht</value>
  173. <value>/platform/system/sysFile/getContentFileByRunId.ht</value>
  174. <!-- flex附件上传的 -->
  175. <value>/platform/bpm/bpmDefinition/getXmlImport.ht</value>
  176. <value>/mobile/system/mobileLogin.ht</value>
  177. <value>/mobile/system/mobileLogout.ht</value>
  178. <value>/mobile/system/mobileApkVersion/info.ht </value>
  179. <value>/proxy</value>
  180. <value>/weixin/weixin.appcache</value>
  181. <!-- 修改密码页面 -->
  182. <value>/platform/system/sysUser/commonResetPwdView.ht</value>
  183. <value>/platform/system/sysUser/commonResetPwd.ht</value>
  184. <value>/proxy</value>
  185. <value>/receive</value>
  186. <value>/weixin/login.html</value>
  187. <value>/weixin/login.ht</value>
  188. <value>/platform/system/sysFile/getFileById.ht</value>
  189. <value>/platform/system/sysFile/download.ht</value>
  190. <value>/weixin/bulletin/detail.html</value>
  191. <value>/weixin/bulletin/detail.ht</value>
  192. </set>
  193. </property>
  194. </bean>
  195. </beans>