【发布时间】:2020-03-03 17:19:52
【问题描述】:
Using generated security password: f9268f9c-f2e6-4e53-a751-632a7005b807
2020-03-03 13:07:44.539 INFO 4824 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2a92f8c3, org.springframework.security.web.context.SecurityContextPersistenceFilter@412324cd, org.springframework.security.web.header.HeaderWriterFilter@7cf2dd91, org.springframework.security.web.csrf.CsrfFilter@565adf96, org.springframework.security.web.authentication.logout.LogoutFilter@5b3457db, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@b1041fc, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@5e842f37, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@3e06198f, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@574d3e0c, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2b5beb1d, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@4d02763e, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@b273c65, org.springframework.security.web.session.SessionManagementFilter@1f6d3131, org.springframework.security.web.access.ExceptionTranslationFilter@1bf860da, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@11538685]
2020-03-03 13:07:44.612 WARN 4824 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : Unable to start LiveReload server
我没有在 POM 文件中包含 spring 安全依赖项,但我在控制台中看到了这些行。浏览器提示输入用户名和密码。我该如何解决这个问题?
【问题讨论】:
-
运行 mvn dependency:tree 和 grep spring security 来检查它是否以某种方式出现
-
哦,我的错。默认情况下,它具有问题中所示的用户名 user 和密码。有什么方法可以覆盖它?
-
你需要安全吗?
-
有没有办法自定义用户名和密码?是的,我需要安全
标签: spring authentication spring-security microservices netflix-eureka