简体   繁体   English

如何将 Spring Boot 管理客户端元数据发送到管理服务器

[英]How to send Spring Boot admin client meta data to admin server

We have a spring boot application (Spring Boot Admin Client Application) and an Spring Boot Admin server.我们有一个 Spring Boot 应用程序(Spring Boot Admin Client Application)和一个 Spring Boot Admin 服务器。 The client application has actuator module and uses database for its user authentication .客户端应用程序具有执行器模块并使用数据库进行用户身份验证。 The problem is I need to register the same client application to admin server.问题是我需要向管理服务器注册相同的客户端应用程序。 I cannot write the username and password in plain text in properties file of client application.我无法在客户端应用程序的属性文件中以纯文本形式写入用户名和密码。 The server is not able to get the health data for the client .服务器无法获取客户端的健康数据。 I need some way so that I can register my client application ?我需要某种方式来注册我的客户端应用程序吗?

You have 2 options:您有 2 个选择:

  1. Make the actuator health endpoint open so that it can be accessed without passing authentication credentials.使执行器运行状况端点打开,以便可以在不传递身份验证凭据的情况下访问它。

    or或者

  2. Publish the username/password as metadata when registering the client application.注册客户端应用程序时,将用户名/密码作为元数据发布。

Please refer to https://codecentric.github.io/spring-boot-admin/2.1.6/#_securing_client_actuator_endpoints :请参考https://codecentric.github.io/spring-boot-admin/2.1.6/#_securing_client_actuator_endpoints

When the actuator endpoints are secured using HTTP Basic authentication the SBA Server needs credentials to access them.当使用 HTTP 基本身份验证保护执行器端点时,SBA 服务器需要凭据才能访问它们。 You can submit the credentials in the metadata when registering the application.您可以在注册应用程序时提交元数据中的凭据。 The BasicAuthHttpHeaderProvider then uses this metadata to add the Authorization header to access your application's actuator endpoints. BasicAuthHttpHeaderProvider 然后使用此元数据添加 Authorization 标头以访问应用程序的执行器端点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM