Search code examples
spring-cloudspring-cloud-config

Using Spring Cloud Config not getting encrypted value?


I am experimenting with Spring Cloud Config Server for encryption/decryption of config values.

For this, under Config Server project made following changes:

In bootstrap.properties

encrypt.key=abcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh

I have also updated JCE using following command in my Ubuntu 18.04 machine:

sudo apt install oracle-java8-unlimited-jce-policy

enter image description here

But after issuing a POST request, I couldn't see anything in response.

enter image description here

Ideally, encrypted text of the request body should be coming as response.

enter image description here

Sample project: https://github.com/Omkar-Shetkar/pluralsight-springcloud-m2-git

What could be missing here ?

Thanks.


Solution

  • It is actually due CSRF, was getting 401-unauthorized response. Since Spring Boot 2.0, we can disable this in code.

    Detailed answer is available here: spring config server encrypt forbidden

    Following above steps solved the issue.