Spring Cloud Config Client JWT uses JWT authentication approach instead of standard Basic Authentication. Please keep in mind Spring Cloud Config Server needs some changes too. Find sample code here
Authentication flow has following steps:
- Client sends request with username/password to Server's Authentication REST Controller.
- Server returns back JWT.
- Client includes Token with Bearer: prefix into Authorization Header for querying configuration values from Config Server.
- Build with Maven using clean package
- Include spring-cloud-config-client-jwt and spring-cloud-starter-config into pom.xml for your project.
- Keep standard spring.cloud.config.uri, spring.cloud.config.username, spring.cloud.config.password and new spring.cloud.config.enabled=false, spring.cloud.config.endpoint={YOUR_CONFIG_SERVER_URL}/auth values into your bootstrap.properties
spring.application.name=my-service
spring.cloud.config.uri=http://localhost:8888
spring.cloud.config.username=user
spring.cloud.config.password=pwd
spring.cloud.config.enabled=false
spring.cloud.config.endpoint=http://localhost:8888/auth