记EurekaServer配置SpringSecurity,erueka报Cannot execute request on any known server

89 阅读1分钟

application.properties

application-euk1.properties

解决方法

1、修改application-euk1.properties配置,在eureka.client.service-url.defaultZone中添加security的账号密码,例如qwe:123@euka2.com:7002/eureka/

2、添加过滤规则

或者禁用csrf

@EnableWebSecurity
@Configurable
public class WebSecurityConfig  extends WebSecurityConfigurerAdapter {   
     @Override    
    protected void configure(HttpSecurity http) throws Exception {       
         //禁用        
        http.csrf().disable();        
        super.configure(http);    
    }
}