Giter Site home page Giter Site logo

ka4ok85 / spring-cloud-config-client-jwt Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 52 KB

Client with JWT support for Spring Cloud Config

Shell 37.23% Batchfile 28.75% Java 34.02%
jwt-authentication jwt-tokens jwt jwt-bearer-tokens cloud-config spring-cloud-config spring-cloud-microservice microservice spring-boot spring

spring-cloud-config-client-jwt's Introduction

spring-cloud-config-client-jwt

JWT minded Configuration Integration for Spring Cloud Config Client

Features

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:

  1. Client sends request with username/password to Server's Authentication REST Controller.
  2. Server returns back JWT.
  3. Client includes Token with Bearer: prefix into Authorization Header for querying configuration values from Config Server.

Usage

  1. Build with Maven using clean package
  2. Include spring-cloud-config-client-jwt and spring-cloud-starter-config into pom.xml for your project.
  3. 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

Sample 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

spring-cloud-config-client-jwt's People

Contributors

ka4ok85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-cloud-config-client-jwt's Issues

Cloud not locate property resouce : 401 null

I tried the same implementation as you have posted, since my requirement is implement spring cloud config with JWT
I'm facing issue when my client application runs with the following error : "Cloud not locate property resouce : 401 null"
Its due to the security we set at the config server with JWT. The JWT token is fetched to the client application after the inital default client trying to fetch the config server properties mentioned in the bootstrap.properties.

I have searched almost everywhere but i came to the above conclusion that the custom Configuration Property class is loading later than the default one. Did you too face the same issue, if yes how did you manage to load your custom Configuration class 1st?

Kindly suggest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.