Spring Eureka请求用户名密码认证

Spring Eureka asks for username password authentication

    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 安全依赖项,但我在我的控制台中看到了这些行。浏览器提示输入用户名和密码。我该如何解决这个问题?

我不认为你应该在 POM 中验证或依赖

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>

已解决! Eureka服务器默认有用户名密码认证。默认用户名为user,密码会在控制台生成!