我创建了一些微服务作为我的学生工作。我创建了2个微服务,它们运行,没有错误。它们很容易注册到Eureka 服务器。很好,但当我转到localhost:8080或其他时,我看到登录页面。标准登录(sa,空)不起作用。
当我将属性更改为其他登录/通行证时-它不起作用。我尝试切换,没有结果。我尝试使用WebSecurityConfig关闭身份验证
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests((requests) -> requests
.anyRequest().permitAll()
)
.csrf(csrf -> csrf.disable()); //
return http.build();
字符串
没有结果。我仍然看到登录页面。实际上,我根本不需要这个认证(这只是学生工作),但我不能使用 Postman 。
AME=“Linux Mint”版本=“21.1(Vera)”
Spring-boot-starter-parent 3.1.5
spring-cloud.version>2022.0.4
IntelliJ U
org.springframework. Boot spring- Boot -starter-security
1条答案
按热度按时间vc9ivgsu1#
你是否在你的pom文件中包含了Spring Security 作为依赖项?如果你不需要它,你可以删除它。或者你可以简单地关闭所有
security.ignored=/**
的安全性。