title: Unable to call the /encrypt endpoint with Spring Cloud + boot in v2.0.X
body: <p>I was using the Spring Cloud and Security example. In this example, I was using Spring Boot version <code>1.4.1.RELEASE</code>. Spring Boot parent version to <code>2.0.4.RELASE</code>. The moment I updated the dependency following endpoint started breaking.</p>
  
  <p>I already went through <a href="https://stackoverflow.com/questions/37488311/spring-cloud-config-encrypt-password">Spring Cloud Config - Encrypt Password</a> and documentation <a href="http://cloud.spring.io/spring-cloud-static/Finchley.RELEASE/single/spring-cloud.html" rel="nofollow noreferrer">http://cloud.spring.io/spring-cloud-static/Finchley.RELEASE/single/spring-cloud.html</a>, but not sure why I am getting forbiddeb error.</p>
  
  <p>I tried using CURL and POSTMAN, get the forbidden error.</p>
  
  <blockquote>
    <p>C:\Users\pc>curl localhost:8888/encrypt -d connectionstring=server123;user=root;password@word1
    {"timestamp":"2018-09-01T12:53:17.382+0000","status":403,"error":"Forbidden","message":"Forbidden","path":"/encrypt"}
    C:\Users\pc> </p>
  </blockquote>
  
  <p><em>NOTE: My Server running on port 8888 fine &amp; JCE files are added already</em></p>
  
  <p>POST : <a href="http://localhost:8888/encrypt" rel="nofollow noreferrer">http://localhost:8888/encrypt</a></p>
  
  <p><a href="https://i.stack.imgur.com/xYdXd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xYdXd.png" alt="enter image description here"></a></p>
  
  <p>The code I used below</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.4.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Finchley.SR1&lt;/spring-cloud.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-config-server&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p><strong>application.yml</strong></p>
  
  <pre><code>---
  
  server:
    port: 8888
  
  
  spring:
    cloud:
      config:
        server:
          git:
            uri: https://github.com/rseroter/pluralsight-spring-cloudconfig-wa-tolls
  
            search-paths:
            - 'station*'
            repos:
              perf: 
                pattern:
                - "*/perf"
                uri : https://github.com/rseroter/pluralsight-spring-cloudconfig-wa-tolls-perf
                search-paths :
                - 'station*'
  
  # Enable security for Basic Auth
    security:
      user:
        name: ABC_123
        password: ABC##123
  </code></pre>
  
  <p><strong>bootstrap.properties</strong></p>
  
  <pre><code>encrypt.key=ABCDEFGHIJKLMNOPQRSTUVWXYZ
  </code></pre>
  
  <p><strong>WebSecurityConfig.java</strong></p>
  
  <pre><code>@EnableWebSecurity
  @Configuration
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter{
      @Override
      protected void configure(HttpSecurity http) throws Exception{
          http.authorizeRequests().antMatchers("/").permitAll();
      }
  }
  </code></pre>
  
  <p>Project structure:</p>
  
  <p><a href="https://i.stack.imgur.com/hMHUO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hMHUO.png" alt="enter image description here"></a></p>