-
Notifications
You must be signed in to change notification settings - Fork 2.5k
spring boot 2.0,eureka registration failed with spring security #2754
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
Comments
What version of Spring Boot 2.0 and what version of Spring Cloud? |
springBootVersion = '2.0.0.RELEASE' |
ME too! But spring boot 2.0.0.RC1 and spring cloud Finchley.M6 its ok |
I have the same problem. |
have the same problem. |
@happymzw M8 is the only compatible version with 2.0.0.RELEASE |
@spencergibb thanks! |
have the same problem with: but with: |
This is because @EnableWebSecurity is now added by default when Spring Security is on the classpath. This enable CSRF protection by default. You will have the same problem in 1.5.10 if you add
As a team we need to decide what the right course of action is going forward. We will update this issue once we have a solution or any updates. |
Add documentation that mentions having separate authn/authz for UI and API( |
@ryanjbaxter - I'm still seeing the issue with csrf disabled. Running SB 2.0.0.RELEASE and Finchley.M9. I'm binding to a Pivotal Cloud Foundry provided eureka instance by the service registry tile. |
@azizabah If you are binding to a Pivotal CF eureka instance, I dont see why you would have this problem, or why it would be the same problem, it is not using Boot 2.0 |
@ryanjbaxter - You're right. Looks like we're running into a different issue on the pivotal spring cloud connectors not injecting the eureka config information. Sorry about that. |
@spencergibb if use Finchley.M9, how to do it? |
注意:Springboot2.0版本存在bug;切换1.5版本后正常 spring-cloud/spring-cloud-openfeign#13 spring-cloud/spring-cloud-netflix#2754
I see this issue when I deploy my app (registry and client) on PCF, but works okay in local. Is there any workaround? or is it resolved? |
@anandwali there is no way that you are seeing this issue without having spring security on the classpath |
@ryanjbaxter I checked app dependencies. I have included spring-cloud-config-server as dependency and it has transitive dependency on spring-security-crypto and spring-security-rsa. Would these dependencies cause this problem? Should I include spring-security and add Configurer to disable CORS, solve the issue? |
I rechecked my configurations. It was eureka client defaultZone - typo with server.port, that caused the issue. |
With
and |
@Meziano Look at this post: #2754 (comment) It helps. |
Or look at the documentation I added #2992 |
Yes, but the eureka client is able to register even with
which means no security at all. |
Not what I am seeing, without the username and password in |
Remove security settings from eureka config file, and create new @configuration class where you setup the user and disable csrf.
|
Unable to register the client with eureka server (The is no security in the classpath) pom.xml (server)spring boot version 2.0.3.RELEASE org.springframework.cloud org.springframework.cloud application.yml (server)spring: server: eureka: The eureka server started fine and can be accessed at http://localhost:8302/ pom.xml (client)spring boot version 2.0.3.RELEASE org.springframework.cloud org.springframework.cloud application.yml (client)spring: server: eureka: instance: When running the client application, getting the following stack trace2018-07-09 13:42:40.279 INFO 265144 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect 2018-07-09 13:42:52.128 WARN 265144 --- [freshExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: java.net.ConnectException: Connection refused: connect com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server |
Please open a separate issue |
metoo |
@dyhack please dont comment on multiple issues with the same problem, I already answered your question |
where? |
i want to connection the remote eureka server。 |
thanks 。if i have some other questions , may i asl you? |
i know how to solve the problem. |
springboot:2.0.1.RELEASE |
I have use @EnableWebSecurity ,the client can registe when the password is error @ryanjbaxter |
@zhaijp please dont spam us with multiple issues and comments |
|
it works! |
in my case, it works for access to eureka dashboard, but eureka client isn't able to connect to server. |
I also have the problem with it. And I disabled csrf in my configuration.
Eureka Server's application.yml:
Eureka Client application.yml:
The exception is:
It haunt me for a few days, could u please help me out? @ryanjbaxter |
Please don't ask in multiple places (here, stack overflow and eureka). |
@keanu96 : You need to put eureka client request to skip the security config of Eureka server. protected void configure(HttpSecurity http) Hope this helps. |
In response to this problem, the latest version of spring cloud has given the official solution. Add the following code to the eureka server project.
|
spring boot 1.5.x is ok, but when i update to boot 2.0,eureka client registration failed.
1.eureka server config:
2.eureka client config:
3.eureka client logs:
The text was updated successfully, but these errors were encountered: