Chinaunix首页 | 论坛 | 博客
  • 博客访问: 220351
  • 博文数量: 184
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1930
  • 用 户 组: 普通用户
  • 注册时间: 2019-06-17 10:57
文章分类

全部博文(184)

文章存档

2021年(183)

2019年(1)

我的朋友

分类: Java

2021-07-17 10:46:19

 1. 找到项目maven目录

2.在自己项目里面建相同包名,类名

package org.flowable.ui.modeler.conf; 重写ModelerSecurityConfiguration

点击(此处)折叠或打开

  1. package org.flowable.ui.modeler.conf;

  2. import org.flowable.ui.common.security.SecurityConstants;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.core.annotation.Order;
  5. import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  6. import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
  7. import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  8. import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;

  9. /**
  10.  * 说明:重构ModelerSecurity
  11.  * from: fhadmin.cn
  12.  */
  13. @Configuration(proxyBeanMethods = false)
  14. @EnableWebSecurity
  15. public class ModelerSecurityConfiguration {

  16.     @Configuration
  17.     @Order(SecurityConstants.MODELER_API_SECURITY_ORDER)
  18.     public static class ModelerApiWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {
  19.         
  20.         @Override
  21.         protected void configure(HttpSecurity http) throws Exception {
  22.             
  23.             SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
  24.             successHandler.setTargetUrlParameter("redirectTo");

  25.             http.headers().frameOptions().disable();
  26.             
  27.             http.csrf().disable().authorizeRequests().antMatchers("/**/**").permitAll().anyRequest().authenticated().and().httpBasic();
  28.         }

  29.     }

  30. }


阅读(411) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~