[Bug][Eureka] Eureka username/password configuration not taking effect
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, spring-boot
- Domain
- authentication, backend
Research direction
Start in linkis-mg-eureka's pom.xml and application-eureka.yml, then inspect the Eureka server and client security configuration described in the issue. Reproduce the behavior by starting the service and accessing the dashboard, and verify that unauthenticated access is blocked while other services register with the configured credentials.
Written by the indexing model from the issue text.
Description
Search before asking
- I searched the issues and found no similar issues.
Linkis Component
linkis-mg-eureka
What happened
English:
The username and password configured in the Eureka configuration file do not take effect, causing Eureka service to fail to start properly or authentication to fail.
Problem Description:
Users configured Eureka security authentication information in application-eureka.yml or related configuration files:
eureka:
server:
username: admin
password: linkis123
However, the configured username and password do not take effect. After the service starts, Eureka can still be accessed without authentication, or other services fail to authenticate when connecting to Eureka.
中文:
在Eureka配置文件中配置了账号密码,但是配置不生效,导致Eureka服务无法正常启动或认证失败。
问题描述:
用户在 application-eureka.yml 或相关配置文件中配置了Eureka的安全认证信息:
eureka:
server:
username: admin
password: linkis123
但是配置的账号密码没有生效,服务启动后仍然可以无认证访问Eureka,或者其他服务连接Eureka时认证失败。
What you expected to happen
English:
The configured Eureka username and password should take effect:
- Eureka Server should require authentication after startup
- Other Linkis services should be able to successfully register with Eureka using the configured credentials
- Eureka Dashboard should require login to access
中文:
配置的Eureka账号密码应该生效:
- Eureka Server启动后需要认证才能访问
- 其他Linkis服务能够使用配置的账号密码成功注册到Eureka
- Eureka Dashboard需要登录才能访问
How to reproduce
English:
- Configure username and password in
application-eureka.yml - Start linkis-mg-eureka service
- Try to access Eureka Dashboard (http://ip:20303/)
- Observe whether authentication is required, or whether other services can register normally
中文:
- 在
application-eureka.yml中配置账号密码 - 启动 linkis-mg-eureka 服务
- 尝试访问 Eureka Dashboard (http://ip:20303/)
- 观察是否需要认证,或者其他服务是否能正常注册
Anything else
English:
Root Cause:
Eureka's security authentication requires Spring Security related dependencies to take effect. Configuration parameters alone are not sufficient.
Solution:
- Add Spring Security dependency to
linkis-mg-eureka'spom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
- Add Security configuration class to enable basic authentication
- Ensure other services' Eureka client configurations include authentication information
Technical Points:
- Spring Security basic authentication configuration
- Eureka Client authentication configuration
- Configuration encryption storage (optional)
References:
- Spring Cloud Eureka Security: https://cloud.spring.io/spring-cloud-netflix/reference/html/#spring-cloud-eureka-server
中文:
根本原因:
Eureka的安全认证需要引入Spring Security相关依赖才能生效,仅配置参数是不够的。
解决方案:
- 在
linkis-mg-eureka的pom.xml中添加 Spring Security 依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
- 添加 Security 配置类,启用基本认证
- 确保其他服务的Eureka客户端配置包含认证信息
相关技术要点:
- Spring Security 基本认证配置
- Eureka Client 认证配置
- 配置加密存储(可选)
参考文档:
- Spring Cloud Eureka Security: https://cloud.spring.io/spring-cloud-netflix/reference/html/#spring-cloud-eureka-server
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Linkis Version
1.8.0
Java Version
OpenJDK 1.8.0
- Dominant language
- Java
- Stars
- 3.4k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/linkis
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100