Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth token cannot be injected to replica requests for Eureka cluster #4046

Open
kyle-wang-sd opened this issue Nov 16, 2021 · 3 comments
Open

Comments

@kyle-wang-sd
Copy link

Hi Spring Cloud Team,

I am using Spring Cloud Netflix as our Discovery Service, and also setup an Eureka cluster with 2 nodes. But got authentication issue for nodes replication with Oauth token.

Spring Cloud Version: 2020.0.2
eureka-core version: 1.10.11

I tried to inject Oauth token with guide: https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#authenticating-with-the-eureka-server, this only works for general user requests to register app and also heartbeat, but doesn't work for cluster nodes replication requests, specifically "/eureka/peerreplication/batch/". So can we improve this to allow customization for replication requests? Or this is an issue for Eureka?

Thanks very much.

@kyle-wang-sd
Copy link
Author

Hi, I found a way to achieve my goal.

WebFilters could be injected to replication requests by providing following bean which references to EurekaServerAutoConfiguration.java

@Bean
public ReplicationClientAdditionalFilters additionalFilters() {
    return new ReplicationClientAdditionalFilters(Collections.emptyList());
}

So my question is, is this a formal way to do so, if then, could this be updated to some documents?

Thanks.

@OlgaMaciaszek
Copy link
Collaborator

@kyle-wang-sd would you like to submit a documentation PR?

@kyle-wang-sd
Copy link
Author

Hi @OlgaMaciaszek , could u guide me how to submit a documentation PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants