Enabling secure communication between client and server

Until now, none of the client's connections were being authenticated by the Eureka Server. While in the development mode, security doesn't really matter as much as in the production mode. The lack of it may be a problem. We would like to have, as a bare minimum, the discovery server secured with basic authentication to prevent unauthorized access to any service that knows its network address. Although Spring Cloud reference material claims that HTTP basic authentication will be automatically added to your Eureka Client, I had to include a starter with security to the project dependencies:

 <dependency>     <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.